Voice announcements: added settings for what to announce

This commit is contained in:
Jonas Kalderstam
2022-02-20 14:42:46 +01:00
committed by Dennis Guse
parent 14b705b43e
commit 00351136f2
7 changed files with 187 additions and 59 deletions
@@ -181,8 +181,10 @@ public class VoiceAnnouncement {
Spannable announcement = VoiceAnnouncementUtils.getAnnouncement(context, track.getTrackStatistics(), unitSystem, isReportSpeed, lastInterval, sensorStatistics);
// We don't care about the utterance id. It is supplied here to force onUtteranceCompleted to be called.
tts.speak(announcement, TextToSpeech.QUEUE_FLUSH, null, "not used");
if (announcement.length() > 0) {
// We don't care about the utterance id. It is supplied here to force onUtteranceCompleted to be called.
tts.speak(announcement, TextToSpeech.QUEUE_FLUSH, null, "not used");
}
}
public void stop() {