From 75c2ffc0b57fc4d4d360472742259cfbbbdf9a12 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 24 Jul 2025 13:57:46 -0400 Subject: [PATCH] Check if audio context is already available, create one if not --- src/pipecat/services/elevenlabs/tts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipecat/services/elevenlabs/tts.py b/src/pipecat/services/elevenlabs/tts.py index 7ea3f92f1..8ceae0abc 100644 --- a/src/pipecat/services/elevenlabs/tts.py +++ b/src/pipecat/services/elevenlabs/tts.py @@ -650,7 +650,8 @@ class ElevenLabsTTSService(AudioContextWordTTSService): # an interruption, which resets the context ID. if not self._context_id: self._context_id = str(uuid.uuid4()) - await self.create_audio_context(self._context_id) + if not self.audio_context_available(self._context_id): + await self.create_audio_context(self._context_id) # Initialize context with voice settings msg = {"text": " ", "context_id": self._context_id}