Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/pipecat/transports/base_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,16 @@ async def process_frame(self, frame: Frame, direction: FrameDirection):
else:
await self._handle_frame(frame)

async def push_frame(self, frame: Frame, direction: FrameDirection = FrameDirection.DOWNSTREAM):
"""Push a frame to the next processor in the pipeline."""
if isinstance(frame, BotStoppedSpeakingFrame) and direction == FrameDirection.DOWNSTREAM:
destination = frame.transport_destination
logger.debug(
f"Bot{f' [{destination}]' if destination else ''} stopped speaking"
)

await super().push_frame(frame, direction)

async def _handle_frame(self, frame: Frame):
"""Handle frames by routing them to appropriate media senders."""
if frame.transport_destination not in self._media_senders:
Expand Down Expand Up @@ -755,10 +765,6 @@ async def _bot_stopped_speaking(self):
# discarded rather than flushed, since it's no longer wanted.
self._audio_buffer = bytearray()

logger.debug(
f"Bot{f' [{self._destination}]' if self._destination else ''} stopped speaking"
)

downstream_frame = BotStoppedSpeakingFrame()
downstream_frame.transport_destination = self._destination
upstream_frame = BotStoppedSpeakingFrame()
Expand Down