From 6d8b88507140887ba9fe7b7c58546bf50abc2b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 6 Nov 2024 11:34:52 -0800 Subject: [PATCH] transports(base_output): push bot started/stopped frames downstream --- src/pipecat/transports/base_output.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pipecat/transports/base_output.py b/src/pipecat/transports/base_output.py index e6c006145..0ae79b9f0 100644 --- a/src/pipecat/transports/base_output.py +++ b/src/pipecat/transports/base_output.py @@ -208,12 +208,14 @@ class BaseOutputTransport(FrameProcessor): async def _bot_started_speaking(self): if not self._bot_speaking: logger.debug("Bot started speaking") + await self.push_frame(BotStartedSpeakingFrame()) await self.push_frame(BotStartedSpeakingFrame(), FrameDirection.UPSTREAM) self._bot_speaking = True async def _bot_stopped_speaking(self): if self._bot_speaking: logger.debug("Bot stopped speaking") + await self.push_frame(BotStoppedSpeakingFrame()) await self.push_frame(BotStoppedSpeakingFrame(), FrameDirection.UPSTREAM) self._bot_speaking = False @@ -452,6 +454,7 @@ class BaseOutputTransport(FrameProcessor): # it's actually speaking. if isinstance(frame, TTSAudioRawFrame): await self._bot_started_speaking() + await self.push_frame(BotSpeakingFrame()) await self.push_frame(BotSpeakingFrame(), FrameDirection.UPSTREAM) # Also, push frame downstream in case anyone else needs it.