Send interruption message to cartesia

This commit is contained in:
balalo
2024-12-05 16:23:40 +01:00
parent 00fd381808
commit bc699735a3

View File

@@ -210,6 +210,8 @@ class CartesiaTTSService(WordTTSService):
async def _handle_interruption(self, frame: StartInterruptionFrame, direction: FrameDirection):
await super()._handle_interruption(frame, direction)
await self.stop_all_metrics()
cancel_msg = json.dumps({"context_id": self._context_id, "cancel": True})
await self._get_websocket().send(cancel_msg)
self._context_id = None
async def flush_audio(self):