Routing the audio through the audio context queue.
This commit is contained in:
@@ -281,13 +281,14 @@ class DeepgramSageMakerTTSService(TTSService):
|
|||||||
except (UnicodeDecodeError, json.JSONDecodeError):
|
except (UnicodeDecodeError, json.JSONDecodeError):
|
||||||
# Not JSON — treat as raw audio bytes
|
# Not JSON — treat as raw audio bytes
|
||||||
await self.stop_ttfb_metrics()
|
await self.stop_ttfb_metrics()
|
||||||
|
context_id = self.get_active_audio_context_id()
|
||||||
frame = TTSAudioRawFrame(
|
frame = TTSAudioRawFrame(
|
||||||
payload,
|
payload,
|
||||||
self.sample_rate,
|
self.sample_rate,
|
||||||
1,
|
1,
|
||||||
context_id=self.get_active_audio_context_id(),
|
context_id=context_id,
|
||||||
)
|
)
|
||||||
await self.push_frame(frame)
|
await self.append_to_audio_context(context_id, frame)
|
||||||
|
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
logger.debug("TTS response processor cancelled")
|
logger.debug("TTS response processor cancelled")
|
||||||
|
|||||||
Reference in New Issue
Block a user