diff --git a/engine/core/duplex_pipeline.py b/engine/core/duplex_pipeline.py index a4fe91b..6e7a0ea 100644 --- a/engine/core/duplex_pipeline.py +++ b/engine/core/duplex_pipeline.py @@ -813,6 +813,12 @@ class DuplexPipeline: # Prime ASR with a short pre-speech context window so the utterance # start isn't lost while waiting for VAD to transition to Speech. pre_roll = self._pre_speech_buffer + # _pre_speech_buffer already includes current speech frames; avoid + # duplicating onset audio when we append pending speech below. + if self._pending_speech_audio and len(pre_roll) > len(self._pending_speech_audio): + pre_roll = pre_roll[:-len(self._pending_speech_audio)] + elif self._pending_speech_audio: + pre_roll = b"" capture_audio = pre_roll + self._pending_speech_audio if capture_audio: await self.asr_service.send_audio(capture_audio)