Skip to content

Commit c4d1b89

Browse files
committed
Adding changelog entry for the Sarvam fixes.
1 parent fd8c6c8 commit c4d1b89

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

changelog/4082.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixed `SarvamTTSService` audio and error frames now route through `append_to_audio_context()` instead of `push_frame()`, ensuring correct behavior with audio contexts and interruptions.

src/pipecat/services/sarvam/tts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,9 +1156,7 @@ async def _receive_messages(self):
11561156
# Check for interruption before processing audio
11571157
await self.stop_ttfb_metrics()
11581158
audio = base64.b64decode(msg["data"]["audio"])
1159-
frame = TTSAudioRawFrame(
1160-
audio, self.sample_rate, 1, context_id=context_id
1161-
)
1159+
frame = TTSAudioRawFrame(audio, self.sample_rate, 1, context_id=context_id)
11621160
await self.append_to_audio_context(context_id, frame)
11631161
elif msg.get("type") == "error":
11641162
error_msg = msg["data"]["message"]
@@ -1167,7 +1165,9 @@ async def _receive_messages(self):
11671165
# If it's a timeout error, the connection might need to be reset
11681166
if "too long" in error_msg.lower() or "timeout" in error_msg.lower():
11691167
logger.warning("Connection timeout detected, service may need restart")
1170-
await self.append_to_audio_context(context_id, ErrorFrame(error=f"TTS Error: {error_msg}"))
1168+
await self.append_to_audio_context(
1169+
context_id, ErrorFrame(error=f"TTS Error: {error_msg}")
1170+
)
11711171

11721172
async def _keepalive_task_handler(self):
11731173
"""Handle keepalive messages to maintain WebSocket connection."""

0 commit comments

Comments
 (0)