From c3d6e965d80f10f491d0cf62bec7a57663c79fd5 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Fri, 13 Mar 2026 18:43:54 -0400 Subject: [PATCH] Use TextAggregationMode.TOKEN in the 05-sync-speech-and-image example since the SentenceAggregator already provides complete sentences. --- examples/foundational/05-sync-speech-and-image.py | 5 +++++ src/pipecat/processors/frame_processor.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/foundational/05-sync-speech-and-image.py b/examples/foundational/05-sync-speech-and-image.py index 35f8f411c..b896261ae 100644 --- a/examples/foundational/05-sync-speech-and-image.py +++ b/examples/foundational/05-sync-speech-and-image.py @@ -31,6 +31,7 @@ from pipecat.runner.utils import create_transport from pipecat.services.cartesia.tts import CartesiaHttpTTSService from pipecat.services.fal.image import FalImageGenService from pipecat.services.openai.llm import OpenAILLMService +from pipecat.services.tts_service import TextAggregationMode from pipecat.transports.base_transport import BaseTransport, TransportParams from pipecat.transports.daily.transport import DailyParams @@ -114,6 +115,10 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): settings=CartesiaHttpTTSService.Settings( voice="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady ), + # No need to aggregate by sentences (the default), as we already know we're getting full sentences + # (Otherwise the service will unnecessarily wait for follow-up input to confirm the sentence is complete, + # which, sadly, actually breaks the synchronization mechanism) + text_aggregation_mode=TextAggregationMode.TOKEN, ) imagegen = FalImageGenService( diff --git a/src/pipecat/processors/frame_processor.py b/src/pipecat/processors/frame_processor.py index f3d9fbdea..a74ee4f81 100644 --- a/src/pipecat/processors/frame_processor.py +++ b/src/pipecat/processors/frame_processor.py @@ -633,7 +633,7 @@ class FrameProcessor(BaseObject): async def pause_processing_frames(self): """Pause processing of queued frames.""" - logger.trace(f"{self}: pausing frame processing") + logger.debug(f"{self}: pausing frame processing") self.__should_block_frames = True if self.__process_event: self.__process_event.clear() @@ -647,7 +647,7 @@ class FrameProcessor(BaseObject): async def resume_processing_frames(self): """Resume processing of queued frames.""" - logger.trace(f"{self}: resuming frame processing") + logger.debug(f"{self}: resuming frame processing") if self.__process_event: self.__process_event.set()