mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Stop TTS playback on new Assist pipeline run (#3778)
This commit is contained in:
parent
256835a380
commit
cea54d6895
|
@ -249,6 +249,8 @@ class AssistViewModel @Inject constructor(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stopPlayback()
|
||||||
|
|
||||||
val recording = try {
|
val recording = try {
|
||||||
recorderProactive || audioRecorder.startRecording()
|
recorderProactive || audioRecorder.startRecording()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -269,6 +271,7 @@ class AssistViewModel @Inject constructor(
|
||||||
|
|
||||||
private fun runAssistPipeline(text: String?) {
|
private fun runAssistPipeline(text: String?) {
|
||||||
val isVoice = text == null
|
val isVoice = text == null
|
||||||
|
stopPlayback()
|
||||||
|
|
||||||
val userMessage = AssistMessage(text ?: "…", isInput = true)
|
val userMessage = AssistMessage(text ?: "…", isInput = true)
|
||||||
_conversation.add(userMessage)
|
_conversation.add(userMessage)
|
||||||
|
|
|
@ -224,6 +224,8 @@ class ConversationViewModel @Inject constructor(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stopPlayback()
|
||||||
|
|
||||||
val recording = try {
|
val recording = try {
|
||||||
recorderProactive || audioRecorder.startRecording()
|
recorderProactive || audioRecorder.startRecording()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -244,6 +246,7 @@ class ConversationViewModel @Inject constructor(
|
||||||
|
|
||||||
private fun runAssistPipeline(text: String?) {
|
private fun runAssistPipeline(text: String?) {
|
||||||
val isVoice = text == null
|
val isVoice = text == null
|
||||||
|
stopPlayback()
|
||||||
|
|
||||||
val userMessage = AssistMessage(text ?: "…", isInput = true)
|
val userMessage = AssistMessage(text ?: "…", isInput = true)
|
||||||
_conversation.add(userMessage)
|
_conversation.add(userMessage)
|
||||||
|
|
Loading…
Reference in a new issue