transports(base_output): push bot started/stopped frames downstream
This commit is contained in:
@@ -208,12 +208,14 @@ class BaseOutputTransport(FrameProcessor):
|
|||||||
async def _bot_started_speaking(self):
|
async def _bot_started_speaking(self):
|
||||||
if not self._bot_speaking:
|
if not self._bot_speaking:
|
||||||
logger.debug("Bot started speaking")
|
logger.debug("Bot started speaking")
|
||||||
|
await self.push_frame(BotStartedSpeakingFrame())
|
||||||
await self.push_frame(BotStartedSpeakingFrame(), FrameDirection.UPSTREAM)
|
await self.push_frame(BotStartedSpeakingFrame(), FrameDirection.UPSTREAM)
|
||||||
self._bot_speaking = True
|
self._bot_speaking = True
|
||||||
|
|
||||||
async def _bot_stopped_speaking(self):
|
async def _bot_stopped_speaking(self):
|
||||||
if self._bot_speaking:
|
if self._bot_speaking:
|
||||||
logger.debug("Bot stopped speaking")
|
logger.debug("Bot stopped speaking")
|
||||||
|
await self.push_frame(BotStoppedSpeakingFrame())
|
||||||
await self.push_frame(BotStoppedSpeakingFrame(), FrameDirection.UPSTREAM)
|
await self.push_frame(BotStoppedSpeakingFrame(), FrameDirection.UPSTREAM)
|
||||||
self._bot_speaking = False
|
self._bot_speaking = False
|
||||||
|
|
||||||
@@ -452,6 +454,7 @@ class BaseOutputTransport(FrameProcessor):
|
|||||||
# it's actually speaking.
|
# it's actually speaking.
|
||||||
if isinstance(frame, TTSAudioRawFrame):
|
if isinstance(frame, TTSAudioRawFrame):
|
||||||
await self._bot_started_speaking()
|
await self._bot_started_speaking()
|
||||||
|
await self.push_frame(BotSpeakingFrame())
|
||||||
await self.push_frame(BotSpeakingFrame(), FrameDirection.UPSTREAM)
|
await self.push_frame(BotSpeakingFrame(), FrameDirection.UPSTREAM)
|
||||||
|
|
||||||
# Also, push frame downstream in case anyone else needs it.
|
# Also, push frame downstream in case anyone else needs it.
|
||||||
|
|||||||
Reference in New Issue
Block a user