ElevenLabs
ElevenLabsSpeechSynthesizer
Bases: BaseModel
Speech synthesizer for ElevenLabs.
voice_stability
class-attribute
instance-attribute
Voice stability for the synthesized speech. It ranges from 0 to 1. Default is 0.5.
voice_similarity_boost
class-attribute
instance-attribute
Voice similarity boost for the synthesized speech. It ranges from 0 to 1. Default is 0.5.
voice_style
class-attribute
instance-attribute
Voice style for the synthesized speech. It ranges from 0 to 1. Default is 0.5.
voice_speaker_boost
class-attribute
instance-attribute
voice_speaker_boost: bool = True
Voice speaker boost for the synthesized speech. Default is True.
language_code
class-attribute
instance-attribute
language_code: LanguageAlpha2 = Field(
default_factory=lambda: LanguageAlpha2("en")
)
Language code of the text to synthesize. If not provided, it defaults to "en".
Check the ElevenLabs API documentation for the list of supported languages by model. https://help.elevenlabs.io/hc/en-us/articles/17883183930129-What-models-do-you-offer-and-what-is-the-difference-between-them
model
class-attribute
instance-attribute
model: Literal[
"eleven_turbo_v2_5",
"eleven_turbo_v2",
"eleven_multilingual_v2",
"eleven_monolingual_v1",
"eleven_multilingual_v1",
] = "eleven_multilingual_v2"
Model ID for ElevenLabs.
timeout
class-attribute
instance-attribute
timeout: int = 120
Timeout for the HTTP request in seconds.
synthesize
synthesize(
texts: Sequence[str],
*,
audio_params: AudioAssetParams | None = None,
**kwargs: Any
) -> list[AudioAsset]
Synthesizes the given texts into audio assets using the ElevenLabs API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
texts |
Sequence[str]
|
List of texts to synthesize. |
required |
audio_params |
AudioAssetParams | None
|
Audio parameters for the synthesized audio assets. |
None
|
kwargs |
Any
|
Additional keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
list[AudioAsset]
|
List of synthesized audio assets. |