Merge pull request #3155 from pipecat-ai/mb/fix-sarvam-tts-not-flushing
fix: flush audio in SarvamTTSService
This commit is contained in:
@@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue in `SarvamTTSService` where the last sentence was not being
|
||||||
|
spoken. Now, audio is flushed when the TTS services receives the
|
||||||
|
`LLMFullResponseEndFrame` or `EndFrame`.
|
||||||
|
|
||||||
- Fixed an issue in `AWSTranscribeSTTService` where the `region` arg was
|
- Fixed an issue in `AWSTranscribeSTTService` where the `region` arg was
|
||||||
always set to `us-east-1` when providing an AWS_REGION env var.
|
always set to `us-east-1` when providing an AWS_REGION env var.
|
||||||
|
|
||||||
|
|||||||
@@ -514,9 +514,11 @@ class SarvamTTSService(InterruptibleTTSService):
|
|||||||
|
|
||||||
async def process_frame(self, frame: Frame, direction: FrameDirection):
|
async def process_frame(self, frame: Frame, direction: FrameDirection):
|
||||||
"""Process a frame and flush audio if it's the end of a full response."""
|
"""Process a frame and flush audio if it's the end of a full response."""
|
||||||
if isinstance(frame, LLMFullResponseEndFrame):
|
await super().process_frame(frame, direction)
|
||||||
|
|
||||||
|
# When the LLM finishes responding, flush any remaining text in Sarvam's buffer
|
||||||
|
if isinstance(frame, (LLMFullResponseEndFrame, EndFrame)):
|
||||||
await self.flush_audio()
|
await self.flush_audio()
|
||||||
return await super().process_frame(frame, direction)
|
|
||||||
|
|
||||||
async def _update_settings(self, settings: Mapping[str, Any]):
|
async def _update_settings(self, settings: Mapping[str, Any]):
|
||||||
"""Update service settings and reconnect if voice changed."""
|
"""Update service settings and reconnect if voice changed."""
|
||||||
|
|||||||
Reference in New Issue
Block a user