From d3ca034c4f14b2a138c68586e54275e89114263c Mon Sep 17 00:00:00 2001 From: filipi87 Date: Thu, 19 Mar 2026 11:40:43 -0300 Subject: [PATCH] Routing the audio through the audio context queue. --- src/pipecat/services/deepgram/sagemaker/tts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/deepgram/sagemaker/tts.py b/src/pipecat/services/deepgram/sagemaker/tts.py index 6add3f951..36541b4be 100644 --- a/src/pipecat/services/deepgram/sagemaker/tts.py +++ b/src/pipecat/services/deepgram/sagemaker/tts.py @@ -281,13 +281,14 @@ class DeepgramSageMakerTTSService(TTSService): except (UnicodeDecodeError, json.JSONDecodeError): # Not JSON — treat as raw audio bytes await self.stop_ttfb_metrics() + context_id = self.get_active_audio_context_id() frame = TTSAudioRawFrame( payload, self.sample_rate, 1, - context_id=self.get_active_audio_context_id(), + context_id=context_id, ) - await self.push_frame(frame) + await self.append_to_audio_context(context_id, frame) except asyncio.CancelledError: logger.debug("TTS response processor cancelled")