Make the TTS playback work by assuming the file is a .wav.

The extension is needed to trigger format detection in the tag reader.
custom
Tursiae 2 months ago
parent f04945fef0
commit 2d8fdbf67f
  1. 6
      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();
}

Loading…
Cancel
Save