From eba8825d9f4df93e3f89010a4349c72046faa16a Mon Sep 17 00:00:00 2001 From: Tursiae Date: Tue, 18 Feb 2025 23:39:48 +1100 Subject: Gate playback on the existence of /.tangara-tts/. Also, clang-format previous changes in provider.hpp. --- src/tangara/tts/player.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tangara/tts/player.cpp') 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}); -- cgit v1.2.3