Stop TTS playback on new Assist pipeline run (#3778)

This commit is contained in:
Joris Pelgröm 2023-08-11 17:31:17 +02:00 committed by GitHub
parent 256835a380
commit cea54d6895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -249,6 +249,8 @@ class AssistViewModel @Inject constructor(
return
}
stopPlayback()
val recording = try {
recorderProactive || audioRecorder.startRecording()
} catch (e: Exception) {
@ -269,6 +271,7 @@ class AssistViewModel @Inject constructor(
private fun runAssistPipeline(text: String?) {
val isVoice = text == null
stopPlayback()
val userMessage = AssistMessage(text ?: "", isInput = true)
_conversation.add(userMessage)

View File

@ -224,6 +224,8 @@ class ConversationViewModel @Inject constructor(
return
}
stopPlayback()
val recording = try {
recorderProactive || audioRecorder.startRecording()
} catch (e: Exception) {
@ -244,6 +246,7 @@ class ConversationViewModel @Inject constructor(
private fun runAssistPipeline(text: String?) {
val isVoice = text == null
stopPlayback()
val userMessage = AssistMessage(text ?: "", isInput = true)
_conversation.add(userMessage)