Skip to content

Commit

Permalink
fixes as noted by aleix
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindla committed Sep 25, 2024
1 parent e123f33 commit 3621fce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pipecat/services/ai_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ def __init__(
async def flush_audio(self):
pass

async def say(self, text: str):
await super.say(text)
await self.flush_audio()

async def start(self, frame: StartFrame):
await super().start(frame)
if self._push_stop_frames:
Expand All @@ -278,6 +282,11 @@ async def cancel(self, frame: CancelFrame):
await self._stop_frame_task
self._stop_frame_task = None

async def process_frame(self, frame: Frame, direction: FrameDirection):
super().process_frame(frame, direction)
if isinstance(frame, TTSSpeakFrame):
await self.flush_audio()

async def push_frame(self, frame: Frame, direction: FrameDirection = FrameDirection.DOWNSTREAM):
await super().push_frame(frame, direction)

Expand Down

0 comments on commit 3621fce

Please sign in to comment.