Skip to content

Commit 586dbc2

Browse files
committed
cancelCallout is always called from user action so clear TTS queue
Although cancelCallout was successfully cancelling other hear my surroundings calls it wasn't over-riding auto callouts. This changes ensures that it always takes precedent.
1 parent 3e63626 commit 586dbc2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/src/main/java/org/scottishtecharmy/soundscape/services/SoundscapeService.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,11 @@ class SoundscapeService : MediaSessionService() {
550550

551551
private fun cancelCallout(): Boolean {
552552
val wasActive = calloutJob?.isActive == true
553-
if (wasActive) {
553+
if (wasActive)
554554
calloutJob?.cancel()
555-
audioEngine.clearTextToSpeechQueue()
556-
}
555+
556+
// Always clear the TTS queue as there's been a user action that requires a response
557+
audioEngine.clearTextToSpeechQueue()
557558
return wasActive
558559
}
559560

0 commit comments

Comments
 (0)