prehistoric-alligator-43413
12/01/2025, 7:46 PMtall-airline-16756
12/01/2025, 7:46 PMtall-airline-16756
12/01/2025, 7:47 PMvoice_id and model are you using for the Dutch voice?
2. Do you set language="nl" in the ElevenLabs TTS config (example: model="eleven_multilingual_v2", language="nl")?
3. Are you using LiveKit’s ElevenLabs plugin with your own ElevenLabs API key, or LiveKit Inference (managed)?
4. Can you reproduce the failure calling ElevenLabs directly (outside LiveKit) with the same voice_id and model?
5. Does the failure always happen immediately, or is it intermittent? Any network/firewall restrictions on outbound connections?
What you can try right now:
• Verify the Dutch voice_id via ElevenLabs’ list_voices endpoint and confirm it supports Dutch and the eleven_multilingual_v2 model.
• Explicitly set language="nl" and model="eleven_multilingual_v2" in your LiveKit TTS config.
• Test the same request directly against ElevenLabs to see if the connection closes there as well (this isolates LiveKit vs ElevenLabs).
• If it’s intermittent, try a few retries and check network latency or firewall rules (the error shows connection closed / status_code=-1 which indicates a dropped/closed connection).
Send me the voice_id, model, and whether direct ElevenLabs calls succeed and I’ll suggest the next steps.
Sources: ElevenLabs TTS plugin guide | LiveKit Docs | ElevenLabs TTS | LiveKit Docsprehistoric-alligator-43413
12/01/2025, 7:56 PMtall-airline-16756
12/01/2025, 7:56 PMh6uBOiAjLKklte8hdYio while the same voice works when called directly.
Immediate checks (do these now):
1. Re-run LiveKit with the minimal TTS config to rule out extra params:
tts = elevenlabs.TTS(
voice_id="h6uBOiAjLKklte8hdYio",
model="eleven_multilingual_v2",
language="nl"
)
1. Remove any voice_settings (stability/similarity) or SSML — use defaults only.
2. Enable debug logging in the LiveKit agent so we capture the WebSocket handshake and exact plugin request/response (this will show whether LiveKit sends different parameters or endpoint).
Things this will rule out:
• malformed/unsupported voice settings sent by LiveKit
• parameter mismatch (language/model/voice) during the plugin WebSocket handshake
• immediate client-side rejection before the ElevenLabs API responds
If debug logs still show connection closed (status_code=-1) immediately, please paste (or confirm) the following from the LiveKit debug output:
• The exact outgoing ElevenLabs request JSON or the logged plugin init payload
• Any plugin-level headers or endpoint URL shown in logs
• The first 2–3 debug lines around the WebSocket connect attempt
Next steps I’ll take once you provide those logs:
• Inspect the plugin init payload for parameter mismatches or unsupported fields.
• Verify LiveKit’s streaming call uses the same ElevenLabs endpoint/mode as your direct test.
• Suggest a configuration change (or a temporary fallback to non-streaming TTS) depending on what the logs show.
Would you like me to analyze the debug logs now?
Sources: ElevenLabs TTS plugin guide | LiveKit Docs | ElevenLabs TTS | LiveKit Docs | Events and error handling | LiveKit docsprehistoric-alligator-43413
12/01/2025, 8:37 PMvoice_settings (stability/similarity) or SSML — use defaults only.
should i remove speed too?tall-airline-16756
12/01/2025, 8:38 PMspeed as well. Use the absolute minimal config (voice_id, model, language) with no voice_settings (stability, similarity, speed) and no SSML so we can isolate whether LiveKit is altering or rejecting any parameter.
If that fixes it, re-add settings one at a time (speed last) and share which setting reproduces the failure.prehistoric-alligator-43413
12/01/2025, 8:57 PMtall-airline-16756
12/01/2025, 8:57 PMspeed.
Cause: elevenlabs.VoiceSettings requires stability and similarity_boost positional args in its constructor, so calling it with only speed= raises the TypeError.
What to do now:
• Don’t construct VoiceSettings at all. Use the minimal TTS config with no voice_settings object:
tts = elevenlabs.TTS(
voice_id="h6uBOiAjLKklte8hdYio",
model="eleven_multilingual_v2",
language="nl"
)
• If your code must call VoiceSettings, pass valid defaults for the required fields plus speed. Example:
voice_settings = elevenlabs.VoiceSettings(
stability=0.5,
similarity_boost=0.75,
speed=1.0
)
(use values you prefer; start with 0.5/0.75/1.0 to test)
Next step: Try running LiveKit with the minimal config (no voice_settings). If it still fails, paste the debug lines around the WebSocket connect and the plugin init payload and I’ll inspect them.prehistoric-alligator-43413
12/01/2025, 8:58 PMtall-airline-16756
12/01/2025, 8:58 PMVoiceSettings fields (stability and similarity_boost) when you set speed. Example safe defaults you can tweak:
voice_settings = elevenlabs.VoiceSettings(
stability=0.5,
similarity_boost=0.75,
speed=1.25 # 0.25 - 4.0, increase >1.0 to speed up, <1.0 to slow down
)
tts = elevenlabs.TTS(
voice_id="h6uBOiAjLKklte8hdYio",
model="eleven_multilingual_v2",
language="nl",
voice_settings=voice_settings
)
Recommended approach:
• Start with conservative values (e.g., stability=0.5, similarity_boost=0.75) and adjust speed gradually.
• If you hit the original connection error again, remove voice_settings and re-add only speed last to confirm which field triggers the issue.
Want me to suggest specific values for faster or slower speech for Dutch?