Bug Description
Ran into this on 1.4.1 — had speed set to a value outside the valid range and spent some time figuring out why the voice failed. I found it pretty quickly since voice settings was the only thing I'd changed, but without that context it would've been a pain. The plugin doesn't validate or warn on any of the VoiceSettings parameters, so out-of-range values just get sent straight to the 11labs API which silently clamps them. No warning, no error, nothing in the logs — would be nice to improve the experience for future devs.
The Cartesia plugin already does this — _check_generation_config() logs warnings with extra={} for out-of-range speed/volume. The ElevenLabs plugin should do the same.
Expected Behavior
A logger.warning when VoiceSettings params are outside their valid ranges:
stability: 0.0 - 1.0
similarity_boost: 0.0 - 1.0
style: 0.0 - 1.0
speed: 0.7 - 1.2
Should be warnings not exceptions — 11labs could change the ranges, but at least devs would have something in the logs to go on.
Reproduction Steps
- Set up ElevenLabs TTS with an out-of-range speed:
from livekit.plugins.elevenlabs import TTS, VoiceSettings
tts = TTS(
voice_settings=VoiceSettings(
stability=0.5,
similarity_boost=0.5,
speed=0.5, # below min of 0.7
)
)
- Synthesize speech — voice failed
- Check logs — nothing. No warning about the bad speed value
- Same thing happens through
update_options()
Operating System
macOS Sequoia
Models Used
ElevenLabs TTS (eleven_turbo_v2_5)
Package Versions
livekit-plugins-elevenlabs==1.4.1
livekit-agents==1.4.1
Proposed Solution
Add a _validate_voice_settings() function following the Cartesia _check_generation_config() pattern — logger.warning() with extra={} context for each param. Call it from TTS.__init__() and TTS.update_options() when voice_settings is provided.
Happy to put up a PR for this.
Bug Description
Ran into this on 1.4.1 — had
speedset to a value outside the valid range and spent some time figuring out why the voice failed. I found it pretty quickly since voice settings was the only thing I'd changed, but without that context it would've been a pain. The plugin doesn't validate or warn on any of theVoiceSettingsparameters, so out-of-range values just get sent straight to the 11labs API which silently clamps them. No warning, no error, nothing in the logs — would be nice to improve the experience for future devs.The Cartesia plugin already does this —
_check_generation_config()logs warnings withextra={}for out-of-range speed/volume. The ElevenLabs plugin should do the same.Expected Behavior
A
logger.warningwhenVoiceSettingsparams are outside their valid ranges:stability: 0.0 - 1.0similarity_boost: 0.0 - 1.0style: 0.0 - 1.0speed: 0.7 - 1.2Should be warnings not exceptions — 11labs could change the ranges, but at least devs would have something in the logs to go on.
Reproduction Steps
update_options()Operating System
macOS Sequoia
Models Used
ElevenLabs TTS (eleven_turbo_v2_5)
Package Versions
Proposed Solution
Add a
_validate_voice_settings()function following the Cartesia_check_generation_config()pattern —logger.warning()withextra={}context for each param. Call it fromTTS.__init__()andTTS.update_options()when voice_settings is provided.Happy to put up a PR for this.