Hi, why am I getting this error: 2025-10-03 12:02:...
# ask-ai
b
Hi, why am I getting this error: 2025-10-03 120248,885 - WARNING livekit.agents - failed to synthesize speech, retrying in 2.0s Traceback (most recent call last): File "/Users/sebastianescudero/Desktop/signalcore-repos/signalcore/agent-backend/.pixi/envs/default/lib/python3.13/site-packages/livekit/agents/tts/tts.py", line 368, in _main_task raise APIError(f"no audio frames were pushed for text: {self._pushed_text}") livekit.agents._exceptions.APIError:
t
Thanks for reaching out, Sebastian. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you get this sorted out! Could you please share a bit more about your setup? For example: • Are you using a particular text-to-speech (TTS) engine or any special configuration? • What text input or API call were you using when this error popped up? • Have there been any recent changes to your LiveKit environment or its dependencies? Having these details will really help us get to the bottom of the issue together.
b
I'm using cartesia sonic-2 on livekit inference
t
I'm sorry to hear you're encountering this error with the Cartesia Sonic-2 TTS engine. It happens when the engine processes your text input but can't generate any audio data. This might be due to a few reasons: • Invalid Model Parameters: Sometimes, using parameters like
speed
or
emotion
with the
sonic-2
model can cause issues, as these parameters are only supported with
sonic-2-2025-03-07
, which isn't available in your current setup. • Invalid or Non-Synthesizable Text: Your input text might include placeholders that the engine can't resolve, or it could be just punctuation or non-text characters that the TTS can't process. • Successful but Invalid Request: Occasionally, the Cartesia API might respond successfully but still fail to generate audio because of internal processing rules. To help you move forward, please check the following: 1. Make sure you're not using
speed
or
emotion
parameters with the
sonic-2
model. 2. Verify that your input text is valid and doesn't contain unsupported characters or placeholders. 3. Confirm that the Cartesia API is properly configured and running smoothly. If you continue to face this issue, just let me know—I'm here to help and we can work through some additional troubleshooting together. Sources: livekit-agents/livekit/agents/tts/fallback_adapter.py
b
I'm just doing this: tts="cartesia/sonic-2:a167e0f3-df7e-4d52-a9c3-f949145efdab",
t
Thank you for sharing the details! The format of your TTS model and voice ID (
cartesia/sonic-2:a167e0f3-df7e-4d52-a9c3-f949145efdab
) looks correct, so the hiccup might be with the voice ID itself. Let’s walk through a few important points together: • Voice ID Scope: LiveKit Inference works with default Cartesia voices only. If
a167e0f3-df7e-4d52-a9c3-f949145efdab
is a custom voice, it won’t be compatible here. For custom voices, you’d want to use the Cartesia plugin along with your own API key. • Voice ID Validity: It’s a good idea to double-check that this voice ID actually exists in the Cartesia Voice Library. If it’s not a valid voice, the synthesis won’t go through. • Authentication: Make sure your LiveKit project is set up properly for inference services — LiveKit takes care of authentication behind the scenes. To help narrow things down, you might try using a known default voice like
cartesia/sonic-2:794f9389-aac1-45b6-b726-9d9369183238
. This can show if the issue is really tied to the voice ID. Please feel free to reach out if you’d like me to guide you through checking the voice ID or if you have any other questions. I’m here to help! Sources: examples/src/basic_agent.ts | livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/models.py | Cartesia TTS | LiveKit Docs | Cartesia TTS plugin guide | LiveKit Docs | Text-to-speech (TTS) models | LiveKit Docs