diff --git a/examples/foundational/11-sound-effects.py b/examples/foundational/11-sound-effects.py index c3912ff6d..d8692a7f1 100644 --- a/examples/foundational/11-sound-effects.py +++ b/examples/foundational/11-sound-effects.py @@ -14,16 +14,18 @@ from pipecat.audio.vad.silero import SileroVADAnalyzer from pipecat.frames.frames import ( Frame, LLMFullResponseEndFrame, - LLMMessagesFrame, OutputAudioRawFrame, ) from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineTask -from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext +from pipecat.processors.aggregators.openai_llm_context import ( + OpenAILLMContext, + OpenAILLMContextFrame, +) from pipecat.processors.frame_processor import FrameDirection, FrameProcessor from pipecat.processors.logger import FrameLogger -from pipecat.services.cartesia import CartesiaHttpTTSService +from pipecat.services.cartesia import CartesiaTTSService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport @@ -72,7 +74,7 @@ class InboundSoundEffectWrapper(FrameProcessor): async def process_frame(self, frame: Frame, direction: FrameDirection): await super().process_frame(frame, direction) - if isinstance(frame, LLMMessagesFrame): + if isinstance(frame, OpenAILLMContextFrame): await self.push_frame(sounds["ding2.wav"]) # In case anything else downstream needs it await self.push_frame(frame, direction) @@ -98,7 +100,7 @@ async def main(): llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"), model="gpt-4o") - tts = CartesiaHttpTTSService( + tts = CartesiaTTSService( api_key=os.getenv("CARTESIA_API_KEY"), voice_id="79a125e8-cd45-4c13-8a67-188112f4dd22", # British Lady ) diff --git a/examples/foundational/assets/ding1.wav b/examples/foundational/assets/ding1.wav index b508dae9a..115398752 100644 Binary files a/examples/foundational/assets/ding1.wav and b/examples/foundational/assets/ding1.wav differ diff --git a/examples/foundational/assets/ding2.wav b/examples/foundational/assets/ding2.wav index 3b8ab20d5..58e3bd6a8 100644 Binary files a/examples/foundational/assets/ding2.wav and b/examples/foundational/assets/ding2.wav differ