"ElevenLabs" (Service Connection)
"ElevenLabs" (Service Connection)
This service connection requires LLM access »
Connecting & Authenticating
ServiceConnect["ElevenLabs"] creates a connection to the ElevenLabs API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
Requests
ServiceExecute["ElevenLabs","request",params] sends a request to the ElevenLabs API, using parameters params. The following give possible requests.
Synthesize Speech
"ListVoices" — list of available voices for speech synthesis
"TextToSpeech" — synthesize speech from text
| "Text" | (required) | the text to synthesize | |
| "Voice" | Automatic | the name or specification for the voice to be used | |
| "VoiceSettings" | Automatic | association of settings for the voice to be used | |
| "ModelID" | Automatic | name of the model to be used | |
| "OptimizeStreamingLatency" | Automatic | integer between 0 and 4 to control latency |
Examples
open all close allBasic Examples (1)
Scope (3)
voice = RandomChoice[ServiceExecute["ElevenLabs", "ListVoices"]]Synthesize a piece of text with that voice:
ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there!", "Voice" -> voice}]Specify the voice just by its name:
ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there!", "Voice" -> voice["Name"]}]Each result will be slightly different since it is produced using a neural network.
Specify settings to be used for the synthesis:
ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there!", "VoiceSettings" -> <|"similarity_boost" -> 1, "stability" -> 0, "style" -> 1|>}]Increasing the "OptimizeStreamingLatency" parameter will return faster results at the cost of quality:
ServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there! This will be a longer sentence", "OptimizeStreamingLatency" -> 4}]//AbsoluteTimingServiceExecute["ElevenLabs", "TextToSpeech", {"Text" -> "hello there! This will be a longer sentence", "OptimizeStreamingLatency" -> 1}]//AbsoluteTimingSee Also
ServiceConnect ▪ ServiceExecute ▪ SpeechSynthesize ▪ VoiceStyleData
History
Introduced in 2024 (14.0)