diff --git a/examples/moondream-chatbot/bot.py b/examples/moondream-chatbot/bot.py index b095acf6b..54c2013b4 100644 --- a/examples/moondream-chatbot/bot.py +++ b/examples/moondream-chatbot/bot.py @@ -13,13 +13,13 @@ from PIL import Image from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.frames.frames import ( + BotStartedSpeakingFrame, + BotStoppedSpeakingFrame, ImageRawFrame, OutputImageRawFrame, SpriteFrame, Frame, LLMMessagesFrame, - TTSAudioRawFrame, - TTSStoppedFrame, TextFrame, UserImageRawFrame, UserImageRequestFrame, @@ -83,14 +83,15 @@ class TalkingAnimation(FrameProcessor): async def process_frame(self, frame: Frame, direction: FrameDirection): await super().process_frame(frame, direction) - if isinstance(frame, TTSAudioRawFrame): + if isinstance(frame, BotStartedSpeakingFrame): if not self._is_talking: await self.push_frame(talking_frame) self._is_talking = True - elif isinstance(frame, TTSStoppedFrame): + elif isinstance(frame, BotStoppedSpeakingFrame): await self.push_frame(quiet_frame) self._is_talking = False - await self.push_frame(frame) + + await self.push_frame(frame, direction) class UserImageRequester(FrameProcessor): @@ -126,7 +127,7 @@ class TextFilterProcessor(FrameProcessor): if frame.text != self.text: await self.push_frame(frame) else: - await self.push_frame(frame) + await self.push_frame(frame, direction) class ImageFilterProcessor(FrameProcessor): @@ -134,7 +135,7 @@ class ImageFilterProcessor(FrameProcessor): await super().process_frame(frame, direction) if not isinstance(frame, ImageRawFrame): - await self.push_frame(frame) + await self.push_frame(frame, direction) async def main(): diff --git a/examples/studypal/studypal.py b/examples/studypal/studypal.py index 1ec165069..bccd7ad27 100644 --- a/examples/studypal/studypal.py +++ b/examples/studypal/studypal.py @@ -128,9 +128,7 @@ async def main(): api_key=os.getenv("CARTESIA_API_KEY"), voice_id=os.getenv("CARTESIA_VOICE_ID", "4d2fd738-3b3d-4368-957a-bb4805275bd9"), # British Narration Lady: 4d2fd738-3b3d-4368-957a-bb4805275bd9 - params=CartesiaTTSService.InputParams( - sample_rate=44100, - ), + sample_rate=44100, ) llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o-mini")