Check if audio context is already available, create one if not

This commit is contained in:
Mark Backman
2025-07-24 13:57:46 -04:00
parent 2297eb217e
commit 75c2ffc0b5

View File

@@ -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}