Add flush_audio() to PlayHTTTSService
This commit is contained in:
@@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Added a `flush_audio()` method to `AzureTTSService` and `FishTTSService`.
|
- Added a `flush_audio()` method to `AzureTTSService`, `FishTTSService`, and
|
||||||
|
`PlayHTTTSService`.
|
||||||
|
|
||||||
- Added `set_language()` and `set_model()` to `AzureSTTService` and
|
- Added `set_language()` and `set_model()` to `AzureSTTService` and
|
||||||
`AssemblySTTService`.
|
`AssemblySTTService`.
|
||||||
|
|||||||
@@ -241,6 +241,14 @@ class PlayHTTTSService(InterruptibleTTSService):
|
|||||||
await self.stop_all_metrics()
|
await self.stop_all_metrics()
|
||||||
self._request_id = None
|
self._request_id = None
|
||||||
|
|
||||||
|
async def flush_audio(self):
|
||||||
|
"""Flush any pending audio in the buffer.
|
||||||
|
|
||||||
|
PlayHT's API doesn't provide a mechanism for flushing audio buffers,
|
||||||
|
so this method is a no-op.
|
||||||
|
"""
|
||||||
|
logger.trace(f"{self}: flush_audio is a no-op for PlayHT")
|
||||||
|
|
||||||
async def _receive_messages(self):
|
async def _receive_messages(self):
|
||||||
async for message in self._get_websocket():
|
async for message in self._get_websocket():
|
||||||
if isinstance(message, bytes):
|
if isinstance(message, bytes):
|
||||||
|
|||||||
Reference in New Issue
Block a user