This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Dhruv. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing that error because Sarvam rejected the websocket request for invalid text — not a network failure. The Sarvam API returned a 400 with: "Text must contain at least one character from the allowed languages." Your code then re‑raised that as an APIConnectionError. What to check next: • Confirm the TTS input text is non‑empty and contains at least one character in the language(s) you set (for example
hi-IN
or
en-IN
). • Verify the request's
target_language_code
(or equivalent) matches the actual characters in the text. • If you build the websocket payload dynamically, log the exact text sent right before the request to ensure no accidental trimming/empty string or characters outside the allowed set. If you want, paste a sample of the text you’re sending and the
target_language_code
you’re using and I’ll point out any mismatch. Sources: Sarvam TTS plugin guide | LiveKit Docs | Sarvam STT plugin guide | LiveKit Docs | Events and error handling | LiveKit docs
n
"APIError: no audio frames were pushed for text: "ठीक है, मैं आपसे कोई अहमियत नहीं ले रही हूँ. अगर आपको भविष्य में सहायता के जरूरत होगी, तब तो आप मुझसे संपर्क कर सकते हैं. धन्यवाद अपना वक्त देने के लिए! "
t
Thanks — that text and error help narrow it down. The "APIError: no audio frames were pushed for text" means Sarvam accepted the request but produced no audio output for that input. Common causes: • The text is treated as invalid for the selected language (even if it appears valid). Sarvam previously returned "Text must contain at least one character from the allowed languages" for similar cases. • The text is empty after preprocessing (trimming, stripping punctuation, removing zero‑width chars). • The voice/language settings (e.g.,
target_language_code
) don’t match the text script so the TTS engine skips generation. Please provide two quick things so I can pinpoint the issue: 1. The
target_language_code
(or language/voice settings) you passed with this request. 2. A minimal reproducible payload you send to Sarvam (the JSON or code snippet that includes text and language/voice fields). If you prefer, paste the exact string as sent (verify there are no hidden characters). I’ll check for mismatches and suggest the fix.