summaryrefslogtreecommitdiff
path: root/src/tangara/tts/player.cpp
diff options
context:
space:
mode:
authorTursiae <git@tursiae.org>2025-02-18 23:39:48 +1100
committerTursiae <git@tursiae.org>2025-02-18 23:41:46 +1100
commiteba8825d9f4df93e3f89010a4349c72046faa16a (patch)
treed1f55d4c19b1c2116f73aa05a61e5fdd9663aa24 /src/tangara/tts/player.cpp
parent49e92c295ea8f2e2cd9b0b23c2ca1479e3f2db2a (diff)
downloadtangara-fw-eba8825d9f4df93e3f89010a4349c72046faa16a.tar.gz
Gate playback on the existence of /.tangara-tts/.
Also, clang-format previous changes in provider.hpp.
Diffstat (limited to 'src/tangara/tts/player.cpp')
-rw-r--r--src/tangara/tts/player.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tangara/tts/player.cpp b/src/tangara/tts/player.cpp
index 9cc7a1f7..1b1e0bcf 100644
--- a/src/tangara/tts/player.cpp
+++ b/src/tangara/tts/player.cpp
@@ -44,7 +44,11 @@ auto Player::playFile(const std::string& text, const std::string& file)
stream_playing_ = true;
}
- openAndDecode(text, file);
+ // Only attempt playback if the card contains samples.
+ // We gate this on directory existence to avoid spamming the logs.
+ if (Provider::SamplesOnSDCard()) {
+ openAndDecode(text, file);
+ }
if (!stream_cancelled_) {
events::Audio().Dispatch(audio::TtsPlaybackChanged{.is_playing = false});