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,6 +650,7 @@ class ElevenLabsTTSService(AudioContextWordTTSService):
# an interruption, which resets the context ID. # an interruption, which resets the context ID.
if not self._context_id: if not self._context_id:
self._context_id = str(uuid.uuid4()) self._context_id = str(uuid.uuid4())
if not self.audio_context_available(self._context_id):
await self.create_audio_context(self._context_id) await self.create_audio_context(self._context_id)
# Initialize context with voice settings # Initialize context with voice settings