Open mfourman4 opened 1 year ago
Here's my entire code:
`import requests from IPython.display import Audio
CHUNK_SIZE = 1024 url = "https://api.elevenlabs.io/v1/text-to-speech/EXAVITQu4vr4xnSDxMaL"
headers = {
"Accept": "audio/mpeg",
"Content-Type": "application/json",
"xi-api-key": "
data = { "text": "", "voice": "Bella", "lang": "pt-PT", "model_id": "eleven_multilingual_v2", "voice_settings": { "stability": 0.5, "similarity_boost": 0.5 } }
response = requests.post(url, json=data, headers=headers)
with open("output.mp3", "wb") as f: for chunk in response.iter_content(chunk_size=CHUNK_SIZE): if chunk: f.write(chunk)
Audio("output.mp3")`
Path: /api-reference/text-to-speech
I a trying to set the language in an API call to Portuguese (Portugal).
I have tried the code:
data = { "text": "Eles jogam futebol aos domingos.", "voice": "Bella", "lang": "pt-PT", "model_id": "eleven_multilingual_v2", "voice_settings": { "stability": 0.5, "similarity_boost": 0.5 } }
But the response I am getting is always in Brazilian Portuguese.
How can I force the language to Portuguese from Portugal?