Move flush_audio to WebsocketTTSService base class

This commit is contained in:
Mark Backman
2025-03-07 12:42:11 -05:00
parent 154fe65011
commit 20ea073398
2 changed files with 15 additions and 4 deletions

View File

@@ -65,6 +65,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `AzureRealtimeBetaLLMService` to support Azure's OpeanAI Realtime API. Added
foundational example `19a-azure-realtime-beta.py`.
### Changed
- Moved `flush_audio()` from the `TTSService` base class to
`WebsocketTTSService`.
### Fixed
- Fixed an issue in `GoogleSTTService`, where it didn't have a `set_language`
function. This required a name change from `set_languages` to `set_language`.
## [0.0.58] - 2025-02-26
### Added

View File

@@ -270,10 +270,6 @@ class TTSService(AIService):
def set_voice(self, voice: str):
self._voice_id = voice
@abstractmethod
async def flush_audio(self):
pass
# Converts the text to audio.
@abstractmethod
async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
@@ -539,6 +535,11 @@ class WebsocketTTSService(TTSService, WebsocketService):
TTSService.__init__(self, **kwargs)
WebsocketService.__init__(self)
@abstractmethod
async def flush_audio(self):
"""Flush any buffered audio in this websocket-based TTS service."""
pass
class InterruptibleTTSService(WebsocketTTSService):
"""This is a base class for websocket-based TTS services that don't support