From 2d8fdbf67f5623ec47a578f31059323ab8bb7d8f Mon Sep 17 00:00:00 2001 From: Tursiae Date: Thu, 6 Feb 2025 00:13:40 +1100 Subject: [PATCH] Make the TTS playback work by assuming the file is a .wav. The extension is needed to trigger format detection in the tag reader. --- src/tangara/tts/provider.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { 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(); }