From 3b55d16a49b426f12fc5e1d955a5e6194745206c Mon Sep 17 00:00:00 2001 From: Ashot Date: Thu, 14 Aug 2025 16:34:34 +0400 Subject: [PATCH] fix(asyncai): force flush WS TTS to eliminate stalls --- CHANGELOG.md | 2 ++ src/pipecat/services/asyncai/tts.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7c617a5f..9b3757920 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed AsyncAI WS TTS startup latency by sending `force=true` + - Fixed an issue with the `BaseWhisperSTTService` where the language was specified as an enum and not a string. diff --git a/src/pipecat/services/asyncai/tts.py b/src/pipecat/services/asyncai/tts.py index e37aa20fa..aa18183fd 100644 --- a/src/pipecat/services/asyncai/tts.py +++ b/src/pipecat/services/asyncai/tts.py @@ -335,7 +335,7 @@ class AsyncAITTSService(InterruptibleTTSService): yield TTSStartedFrame() self._started = True - msg = self._build_msg(text=text) + msg = self._build_msg(text=text, force=True) try: await self._get_websocket().send(msg)