Skip to content

Commit

Permalink
add calls to flush_audio for say() and rtvi action
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindla committed Sep 23, 2024
1 parent a1024bb commit 5bf1b9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pipecat/services/ai_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:

async def say(self, text: str):
await self.process_frame(TextFrame(text=text), FrameDirection.DOWNSTREAM)
await self.flush_audio()

async def _handle_interruption(self, frame: StartInterruptionFrame, direction: FrameDirection):
self._current_sentence = ""
Expand Down Expand Up @@ -235,6 +236,7 @@ async def process_frame(self, frame: Frame, direction: FrameDirection):
await self.push_frame(frame, direction)
elif isinstance(frame, TTSSpeakFrame):
await self._push_tts_frames(frame.text)
await self.flush_audio()
elif isinstance(frame, TTSModelUpdateFrame):
await self.set_model(frame.model)
elif isinstance(frame, TTSVoiceUpdateFrame):
Expand Down

0 comments on commit 5bf1b9f

Please sign in to comment.