future-honey-73772
12/05/2025, 5:20 AMelevenlabs.TTS(_voice_id_="...") or via:
self.tts.update_options(
voice_id=new_voice_id,
voice_settings=VoiceSettings(
speed=new_voice_speed,
stability=stability,
similarity_boost=boost,
)
)
Did this route change in the later updates, is there a different way to select voices with elevenlabs in the latest code?tall-airline-16756
12/05/2025, 5:20 AMtall-airline-16756
12/05/2025, 5:20 AMvoice_id at construction and calling update_options(voice_id=..., voice_settings=...) are still the supported ways to choose a voice. That behavior did not change in the latest LiveKit versions.
Please check these likely causes and confirm details so I can help further:
• Confirm the voice_id you pass is valid for your ElevenLabs account (paste one example voice_id you’re using).
• Confirm your ELEVEN_API_KEY is set and correct in the environment used by your running service.
• Verify the installed plugin/package version (run pip show livekit-plugins-elevenlabs or check requirements.txt) and share the version. The plugin referenced in docs is around ~=1.2.
• If you call update_options, ensure it runs before synthesis starts and is invoked on the same TTS instance used for generation. Share the small code path where you call update_options + the subsequent synth call.
• Restart the session/process to avoid stale cached clients after upgrade; tell me if you already restarted.
• If possible, log or print the active TTS options just before synth to confirm the voice_id and voice_settings values being used.
Share the voice_id, plugin version, and a short snippet showing how/when you call update_options and synthesize — I’ll review and suggest the exact fix.
Sources: ElevenLabs TTS plugin guide | LiveKit Docsfuture-honey-73772
12/05/2025, 5:22 AMtall-airline-16756
12/05/2025, 5:22 AMvoice_id and model you’re passing (one example).
• The LiveKit Agents SDK version (run pip show livekit-agents or show requirements.txt entry).
• A short snippet (5–10 lines) showing where you construct the ElevenLabs TTS, call update_options, and then trigger synthesis.
• A few lines of agent logs around TTS initialization and the synth call (include warnings/errors).
Quick checks to run now:
• Confirm ELEVEN_API_KEY is set in the runtime environment (print a masked value to logs).
• Restart the process after the upgrade to avoid cached clients.
• Make a direct curl/request to ElevenLabs TTS with the same key and voice_id to verify the voice works outside LiveKit.
Send the above items and I’ll review the config/logs and recommend the exact fix.
Sources: ElevenLabs TTS plugin guide | LiveKit Docs | ElevenLabs STT plugin guide | LiveKit docs | Models | LiveKit Docsfuture-honey-73772
12/05/2025, 5:28 AMlogger.info(f"TTS settings: voice_id={self.tts._opts.voice_id}, model={self.tts._opts.model}, "
f"speed={new_voice_speed}, target_lang={target_language_id}")
Result:
TTS settings: voice_id=x5IDPSl4ZUbhosMmVFTk, model=eleven_flash_v2_5, speed=1.0
The voice setting doesn't matchtall-airline-16756
12/05/2025, 5:29 AMvoice_id you passed and using a different voice. Use voice (not voice_id) when constructing the ElevenLabs TTS; the plugin expects voice="EXAVITQu4vr4xnSDxMaL".
Please update the init to:
tts = elevenlabs.TTS(
voice="EXAVITQu4vr4xnSDxMaL",
model="eleven_flash_v2_5"
)
Then log tts._opts.voice (not voice_id) to confirm. If you still see the wrong voice after that, share the post-change log lines and I’ll help trace whether something else (env var, override, or cached instance) is replacing the setting.
Sources: ElevenLabs TTS plugin guide | LiveKit Docsfuture-honey-73772
12/05/2025, 5:30 AMtall-airline-16756
12/05/2025, 5:31 AMvoice, so let's fix this cleanly.
You're on livekit-plugins-elevenlabs 1.3.5 and Python expects voice_id. Your original init using voice_id="EXAVITQu4vr4xnSDxMaL" was correct. The problem is the runtime shows a different voice_id (x5ID...), meaning something is overwriting the option after construction.
Please do the following and share the outputs:
1. Confirm the exact import and instantiation lines (paste 5–10 lines around where you create self.tts).
2. Show the update_options call (the snippet you posted earlier) and where you call the synth method.
3. Add these debug prints/logs and paste their output:
◦ Immediately after construction:
logger.info(f"after init: voice_id={self.tts._opts.voice_id}, model={self.tts._opts.model}")
• Immediately after any update_options call:
logger.info(f"after update: voice_id={self.tts._opts.voice_id}, voice_settings={self.tts._opts.voice_settings}")
• Right before synth:
logger.info(f"before synth: voice_id={self.tts._opts.voice_id}")
1. Confirm ELEVEN_API_KEY at runtime (log a masked prefix, e.g. first 4 chars).
2. Confirm there are no other TTS constructions in your process (search for elevenlabs.TTS().
With those snippets/logs I'll pinpoint whether an override, a secondary initialization, or a timing/caching issue is replacing your voice_id.
Sources: ElevenLabs TTS plugin guide | LiveKit Docsfuture-honey-73772
12/05/2025, 5:41 AMtall-airline-16756
12/05/2025, 5:42 AMELEVEN_API_KEY is set at runtime (env/.env) and paste a masked sample (first 4 chars + ).
• Tell me if you’re running LiveKit Agents locally or calling LiveKit Inference (managed service).
• One short audio sample filename or timestamped log entry of a synth run that produced the wrong voice.
Immediate checks you can run now:
• Make a direct ElevenLabs API call with the same voice_id + model to confirm ElevenLabs returns the expected voice outside LiveKit.
• Try synthesizing with a different known voice_id (e.g., a default listed in your ElevenLabs account) to see if any voice change takes effect.
Send the above outputs and I’ll trace whether the plugin is overriding the voice, the model enforces a different voice, or authentication/quotas are causing a fallback.
Sources: ElevenLabs TTS plugin guide | LiveKit Docs | ElevenLabs TTS | LiveKit Docsfuture-honey-73772
12/05/2025, 5:57 AMtall-airline-16756
12/05/2025, 5:58 AMsample_rate used when constructing the source).
• One audio-frame debug print immediately before publish and immediately after receive (show audio_frame.sample_rate, channel_count, bytes_per_sample, and frame length).
• livekit-agents version and confirmation plugin is 1.3.5, ElevenLabs model name (you said eleven_flash_v2_5), and how ELEVEN_API_KEY is provided.
Quick tests to run now (optional but helpful):
• Synthesize directly with ElevenLabs (curl/SDK) and play locally to confirm original file’s pitch/speed and sample rate.
• Publish a known-good WAV with explicit sample rate (16k/24k) through your pipeline to see if it reproduces correctly.
Send the code snippets and the three sample-rate logs (synth output, publish options, audio_frame before publish) and I’ll tell you exactly which component is resampling or misconfigured and how to fix it.
Sources: Camera & microphone | LiveKit docs | Agent session | LiveKit docs | Processing raw media tracks | LiveKit docs | Agent speech and audio | LiveKit docs | client-sdk-unity | livekit/livekit_composite | DeepWikifuture-honey-73772
12/05/2025, 6:01 AMtall-airline-16756
12/05/2025, 6:02 AMtts = elevenlabs.TTS(voice_id="EXAVITQu4vr4xnSDxMaL", model="eleven_flash_v2_5", sample_rate=24000)
• Ensure your AudioSource/Track is created with the same sample_rate and num_channels.
• If the plugin output rate differs, resample the audio before feeding it to LiveKit (libraries: librosa, pydub, ffmpeg).
• Add debug logs showing the synthesized audio metadata (sample_rate, channels) and the audio_frame.sample_rate just before publish to confirm consistency.
If you want, paste:
• the code that creates/publishes the AudioSource,
• the TTS response metadata (sample rate),
• and a short audio-frame log,
and I’ll point to the exact line to change.
Sources: Camera & microphone | LiveKit docs | ElevenLabs TTS plugin guide | LiveKit Docs | Processing raw media tracks | LiveKit docs