Merge pull request #1342 from pipecat-ai/mb/lmnt-flush-audio

This commit is contained in:
Mark Backman
2025-03-11 22:22:38 -04:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for Chirp voices in `GoogleTTSService`.
- Added a `flush_audio()` method to `FishTTSService`.
- Added a `flush_audio()` method to `FishTTSService` and `LmntTTSService`.
- Added `on_user_turn_audio_data` and `on_bot_turn_audio_data` to
`AudioBufferProcessor`. This gives the ability to grab the audio of only that

View File

@@ -170,6 +170,11 @@ class LmntTTSService(InterruptibleTTSService):
return self._websocket
raise Exception("Websocket not connected")
async def flush_audio(self):
if not self._websocket:
return
await self._get_websocket().send(json.dumps({"flush": True}))
async def _receive_messages(self):
"""Receive messages from LMNT websocket."""
async for message in self._get_websocket():