#how can i use elevenlabs api to get all avilable voices for multi lang model
1 messages · Page 1 of 1 (latest)
To retrieve all available voices for the multilingual model using the ElevenLabs API, you can use the get voices endpoint and filter voices by the model_id. Ensure you set the model_id to "eleven_multilingual_v2", which supports multiple languages. Here's an example script in Python:
import requests
import json
import pprint
# API endpoint for shared voices
url = "https://api.elevenlabs.io/v1/shared-voices"
# Replace with your actual API key
headers = {"xi-api-key": "yourapikeyhere"}
# Parameters to filter voices for multilingual model
params = {
"page_size": 100, # Adjust page size as needed
"category": "professional", # Filter for professional voices
"language": "en", # Replace with desired language code
}
# Make the API request
response = requests.request("GET", url, headers=headers, params=params)
# Parse and display the response
data = json.loads(response.text)
pprint.pprint(data)
# Save the voice data to a file
with open("voice_library.txt", "w", encoding="utf-8") as f:
f.write(json.dumps(data, indent=4))
Key Notes:
- Filter by Language: Use the
languageparameter to specify the target language (e.g.,"en"for English,"es"for Spanish, etc.). - Add Voices to Your Account: Before using a voice for audio generation, you must add it to your Voice Library. This can be done via the API or the ElevenLabs interface.
- Multilingual Model: Ensure the
model_idin your API calls is set to"eleven_multilingual_v2"for accurate pronunciation across multiple languages.
If you need further assistance, feel free to ask!
and how to get all supported lkanguage for model and which the best for multili lang to use
To find all supported languages for a specific model, you can refer to the Help Center article on model differences. The Multilingual v2 model supports 28 languages, while the Turbo v2.5 model supports 32 languages. Both models include Ukrainian among their supported languages.
For multilingual use, the Multilingual v2 model is recommended for content creation as it provides the most life-like audio and better stylistic range. However, it is slower compared to the Turbo models. If speed is a priority and you need real-time conversational capabilities, the Turbo v2.5 model is a better choice, though it has slightly lower accuracy and stylistic range than Multilingual v2.
is there's an end point for getting the supported languages by the Multilingual v2 model in jsob
Yes, you can retrieve the supported languages for a model by using the GET /v1/models endpoint. This will provide a list of all available models, and you can check the details of the Multilingual v2 model to see its supported languages.
To specify a language for a model, you can use the language_code parameter in conjunction with the model_id. For example, the ISO code for German is "de". This allows you to enforce a specific language when generating speech.
If you need further assistance with implementing this, feel free to ask!
useing the js lib how to get all the voices for a spefice language id and mdel id ( with limit to 100 )