feat: add --listen-during-wake-sound argument (#273)

* feat: add --listen-during-wake-sound argument

---------

Co-authored-by: Florian Asche <github@florian-asche.de>
This commit is contained in:
Willian WangandFlorian Asche authored and GitHub committed 2026-07-18 19:16:11 +02:00
1 parent 9b2a8b4b30
commit a66c0e4f28
7 files changed
+48 -5

No files matched your search

+18 -3
View File
@@ -834,10 +834,25 @@ class VoiceSatelliteProtocol(APIServer):
self._pipeline_active = True
self._emit(LVAEvent.WAKE_WORD_DETECTED)
self.duck()
self.state.tts_player.play(
self.state.wakeup_sound,
done_callback=lambda: self._on_wakeup_sound_finished(wake_word_phrase),
if self.state.listen_during_wake_sound:
_LOGGER.debug("Starting audio streaming immediately (listen_during_wake_sound enabled)")
self.state.tts_player.play(self.state.wakeup_sound)
self._start_audio_streaming(wake_word_phrase)
else:
self.state.tts_player.play(
self.state.wakeup_sound,
done_callback=lambda: self._on_wakeup_sound_finished(wake_word_phrase),
)
def _start_audio_streaming(self, wake_word_phrase: str) -> None:
"""Start streaming audio during wake sound detection."""
_LOGGER.debug(
"Starting audio streaming for: %s",
wake_word_phrase,
)
self.send_messages([VoiceAssistantRequest(start=True, wake_word_phrase=wake_word_phrase)])
self._is_streaming_audio = True
self._emit(LVAEvent.LISTENING)
def _on_wakeup_sound_finished(self, wake_word_phrase: str) -> None:
"""Callback invoked when the wakeup chime finishes; begin STT streaming."""