From cf62167f54ec857db9e1059c48f6865b13b11a1a Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 18 Nov 2024 12:25:04 -0500 Subject: [PATCH] Revert: services(cartesia): generated TTSStoppedFrame after no more audio --- src/pipecat/services/cartesia.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/cartesia.py b/src/pipecat/services/cartesia.py index 7fad02fee..0c5102198 100644 --- a/src/pipecat/services/cartesia.py +++ b/src/pipecat/services/cartesia.py @@ -223,13 +223,14 @@ class CartesiaTTSService(WordTTSService): if not msg or msg["context_id"] != self._context_id: continue if msg["type"] == "done": - await self.push_frame(TTSStoppedFrame()) await self.stop_ttfb_metrics() # Unset _context_id but not the _context_id_start_timestamp # because we are likely still playing out audio and need the # timestamp to set send context frames. self._context_id = None - await self.add_word_timestamps([("LLMFullResponseEndFrame", 0), ("Reset", 0)]) + await self.add_word_timestamps( + [("TTSStoppedFrame", 0), ("LLMFullResponseEndFrame", 0), ("Reset", 0)] + ) elif msg["type"] == "timestamps": await self.add_word_timestamps( list(zip(msg["word_timestamps"]["words"], msg["word_timestamps"]["start"]))