5-07-27 18:02:49,435 - ERROR livekit.agents - Erro...
# ask-ai
b
2025-07-27 180249,435 - ERROR livekit.agents - Error in _tts_inference_task Traceback (most recent call last): File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 517, in anext val = await self._event_aiter.__anext__() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ StopAsyncIteration During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/opentelemetry/util/_decorator.py", line 71, in async_wrapper return await func(*args, **kwargs) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/livekit/agents/voice/generation.py", line 212, in _tts_inference_task async for audio_frame in tts_node: File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/livekit/agents/voice/agent.py", line 408, in tts_node async for ev in stream: File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 520, in anext raise exc # noqa: B904 ^^^^^^^^^ File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/opentelemetry/util/_decorator.py", line 71, in async_wrapper return await func(*args, **kwargs) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/mm/lib/python3.12/site-packages/livekit/agents/tts/tts.py", line 356, 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:
t
Thanks for reaching out, aile. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error "no audio frames were pushed for text" in the TTS inference task occurs when the system receives text input but fails to generate any audio output. Below are the steps to troubleshoot and resolve this issue: 1. Check Retry Configuration: Ensure the TTS system's retry logic is properly configured. For example:`conn_options = APIConnectOptions( max_retry=3, # Increase retry attempts timeout=30.0, # Adjust timeout as needed )` 2. Monitor Error Events: Use error event listeners to capture and log recoverable and non-recoverable errors:`def on_tts_error(error_event): logger.error(f"TTS Error: {error_event.error}, Recoverable: {error_event.recoverable}") tts.on("error", on_tts_error)` 3. Validate Input Text: Ensure the text being pushed to the TTS system is valid and not empty. The error message will specify the problematic text. 4. Check TTS Service Availability: Verify network connectivity to the TTS service, API credentials, and ensure there are no service-specific rate limits or quotas being exceeded. 5. Implement Fallback Mechanisms: Use fallback TTS adapters to switch between multiple TTS providers if one fails. 6. Monitor Metrics: Analyze metrics such as
ttfb
(time to first byte),
duration
, and
audio_duration
to identify performance issues. The retry mechanism in the TTS system often resolves this error automatically. However, if the issue persists, it may indicate deeper problems with the TTS service, network, or input validation. Sources: livekit-agents/livekit/agents/voice/generation.py