From 8762506e9f87aa0f47a9de56f027eaa7bb552568 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 7 Jan 2026 08:58:29 -0500 Subject: [PATCH] Update AudioContextTTSService to inherit from WebsocketTTSService --- src/pipecat/services/tts_service.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pipecat/services/tts_service.py b/src/pipecat/services/tts_service.py index 08e3c5220..6b14c905c 100644 --- a/src/pipecat/services/tts_service.py +++ b/src/pipecat/services/tts_service.py @@ -901,7 +901,7 @@ class InterruptibleWordTTSService(WebsocketWordTTSService): self._bot_speaking = False -class AudioContextTTSService(WebsocketService): +class AudioContextTTSService(WebsocketTTSService): """Base class for websocket-based TTS services with audio context management. This is a base class for websocket-based TTS services that allow correlating @@ -921,7 +921,7 @@ class AudioContextTTSService(WebsocketService): Args: reconnect_on_error: Whether to automatically reconnect on websocket errors. - **kwargs: Additional arguments passed to the parent WebsocketService. + **kwargs: Additional arguments passed to the parent WebsocketTTSService. """ super().__init__(reconnect_on_error=reconnect_on_error, **kwargs) self._contexts: Dict[str, asyncio.Queue] = {} @@ -1077,10 +1077,12 @@ class AudioContextWordTTSService(AudioContextTTSService, WebsocketWordTTSService with the word timestamp functionality of WebsocketWordTTSService. """ - def __init__(self, **kwargs): + def __init__(self, *, reconnect_on_error: bool = True, **kwargs): """Initialize the Audio Context Word TTS service. Args: + reconnect_on_error: Whether to automatically reconnect on websocket errors. **kwargs: Additional arguments passed to parent classes. """ - super().__init__(**kwargs) + AudioContextTTSService.__init__(self, reconnect_on_error=reconnect_on_error, **kwargs) + WebsocketWordTTSService.__init__(self, reconnect_on_error=reconnect_on_error, **kwargs)