diff options
| author | Tursiae <git@tursiae.org> | 2025-02-06 00:13:40 +1100 |
|---|---|---|
| committer | Tursiae <git@tursiae.org> | 2025-02-06 16:53:56 +1100 |
| commit | 2d8fdbf67f5623ec47a578f31059323ab8bb7d8f (patch) | |
| tree | f93602a1232079c8c2001b98b0016ae67b73e94b | |
| parent | f04945fef03db6af8b7dbeefe23b4265b0672a8b (diff) | |
| download | tangara-fw-2d8fdbf67f5623ec47a578f31059323ab8bb7d8f.tar.gz | |
Make the TTS playback work by assuming the file is a .wav.
The extension is needed to trigger format detection in the tag reader.
| -rw-r--r-- | src/tangara/tts/provider.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tangara/tts/provider.cpp b/src/tangara/tts/provider.cpp index d19500e0..eedfe959 100644 --- a/src/tangara/tts/provider.cpp +++ b/src/tangara/tts/provider.cpp @@ -28,7 +28,11 @@ static const char* kTtsPath = "/.tangara-tts/"; static auto textToFile(const std::string& text) -> std::optional<std::string> { uint64_t hash = komihash(text.data(), text.size(), 0); std::stringstream stream; - stream << kTtsPath << std::hex << hash; + // Assume the TTS sample is a .wav file; since we only support one low-RAM + // overhead codec, we can presume the suffix. The suffix is needed, else we + // fail to open the stream when it fails to autodetect the format when looking + // up tags. + stream << kTtsPath << std::hex << hash << ".wav"; return stream.str(); } |
