Bug: Random TTS Error — “no audio frames were pushed for text” (LiveKit Agents + Cartesia TTS)
Bug Description
Description
During TTS synthesis, the agent randomly fails with the following error: APIError: no audio frames were pushed for text This leads to repeated retries: 2025-12-03 18:38:22,900 - livekit.agents - WARNING - failed to synthesize speech, retrying in 0.1s The TTS plugin fails to generate any audio frames for a perfectly valid text input. This issue occurs randomly, not consistently.
🧰 Relevant Logs HTTP Request: POST https://api.groq.com/openai/v1/chat/completions "HTTP/1.1 200 OK" WARNING - failed to synthesize speech, retrying in 0.1s livekit.agents._exceptions.APIError: no audio frames were pushed for text: ...
{"level": "INFO", "name": "httpx", "message": "HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"", "pid": 3593, "job_id": "AJ_yMbUGhs5vyyJ", "room_id": "RM_w5B3pNpxSc98", "timestamp": "2025-12-03T18:38:22.740620+00:00"}
2025-12-03 18:38:22,900 - livekit.agents - WARNING - failed to synthesize speech, retrying in 0.1s
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 407, in _main_task
raise APIError(f"no audio frames were pushed for text: {self._pushed_text}")
livekit.agents._exceptions.APIError: no audio frames were pushed for text: You've provided information about the following medications: Briollipta, Albuterol sulfate HFA, Albuterol, Hydrochlorothiazide, and Loratadine. Does this list sound complete to you? (body=None, retryable=True)
2025-12-03 18:38:22,900 - livekit.agents - WARNING - failed to synthesize speech, retrying in 0.1s
Traceback (most recent call last):
File "/app/.venv/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 407, in _main_task
raise APIError(f"no audio frames were pushed for text: {self._pushed_text}")
livekit.agents._exceptions.APIError: no audio frames were pushed for text: You've provided information about the following medications: Briollipta, Albuterol sulfate HFA, Albuterol, Hydrochlorothiazide, and Loratadine. Does this list sound complete to you? (body=None, retryable=True)
{"level": "WARNING", "name": "livekit.agents", "message": "failed to synthesize speech, retrying in 0.1s\nTraceback (most recent call last):\n File \"/app/.venv/lib/python3.12/site-packages/livekit/agents/tts/tts.py\", line 407, in _main_task\n raise APIError(f\"no audio frames were pushed for text: {self._pushed_text}\")\nlivekit.agents._exceptions.APIError: no audio frames were pushed for text: You've provided information about the following medications: Briollipta, Albuterol sulfate HFA, Albuterol, Hydrochlorothiazide, and Loratadine. Does this list sound complete to you? (body=None, retryable=True)", "tts": "livekit.plugins.cartesia.tts.TTS", "attempt": 1, "streamed": true, "pid": 3593, "job_id": "AJ_yMbUGhs5vyyJ", "room_id": "RM_w5B3pNpxSc98", "timestamp": "2025-12-03T18:38:22.900841+00:00"}
Expected Behavior
The TTS engine should generate audio frames for any valid input text. No exceptions should be thrown for normal conversational text.
Reproduction Steps
Use LiveKit Agents with Cartesia TTS enabled.
Attempt to synthesize a normal conversational text.
Occasionally observe repeated warnings and the error:
APIError: no audio frames were pushed.
Operating System
Linux/Ubuntu, Docker
Models Used
Cartesia sonic-3
Package Versions
livekit-agents==1.3.5
livekit-plugins-cartesia==1.3.5
Python 3.12
Session/Room/Call IDs
roomId: RM_w5B3pNpxSc98 job_id: AJ_yMbUGhs5vyyJ
Proposed Solution
Additional Context
No response
Screenshots and Recordings
No response