Android: stop reply speaker on voice teardown

This commit is contained in:
Michael Faath
2026-04-04 23:37:46 +02:00
committed by Ayaan Zaidi
parent 5942b1062e
commit 628fc21192
2 changed files with 11 additions and 4 deletions

View File

@@ -760,7 +760,7 @@ class NodeRuntime(
prefs.setTalkEnabled(value)
if (value) {
// Tapping mic on interrupts any active TTS (barge-in)
talkMode.stopTts()
stopVoicePlayback()
talkMode.ttsOnAllResponses = false
scope.launch { talkMode.ensureChatSubscribed() }
}
@@ -782,12 +782,19 @@ class NodeRuntime(
private fun stopActiveVoiceSession() {
talkMode.ttsOnAllResponses = false
talkMode.stopTts()
stopVoicePlayback()
micCapture.setMicEnabled(false)
prefs.setTalkEnabled(false)
externalAudioCaptureActive.value = false
}
private fun stopVoicePlayback() {
talkMode.stopTts()
if (voiceReplySpeakerLazy.isInitialized()) {
voiceReplySpeaker.stopTts()
}
}
fun refreshGatewayConnection() {
val endpoint =
connectedEndpoint ?: run {

View File

@@ -244,7 +244,7 @@ class MicCaptureManager(
pendingRunId = null
pendingAssistantEntryId = null
_isSending.value = false
if (messageQueue.isNotEmpty()) {
if (hasQueuedMessages()) {
_statusText.value = queuedWaitingStatus()
}
}
@@ -352,7 +352,7 @@ class MicCaptureManager(
_statusText.value =
when {
_isSending.value -> "Listening · sending queued voice"
messageQueue.isNotEmpty() -> "Listening · ${messageQueue.size} queued"
hasQueuedMessages() -> "Listening · ${queuedMessageCount()} queued"
else -> "Listening"
}
_isListening.value = true