Open KarelDierickx opened 2 months ago
I've created a Professional Voice Clone in Dutch. However, when I try to do some lexicon changes through the dictionary, it seems the lexicon only 'speaks' English. This is the code I use:
import requests
api_key = '' voice_id = 'IheMBE86LFF4Xj32yQWB' # Replace with your cloned voice ID url = f'https://api.elevenlabs.io/v1/text-to-speech/IheMBE86LFF4Xj32yQWB'
data = { "voice_id": 'IheMBE86LFF4Xj32yQWB', "text": "Gommeren", "dictionary": { "Gommeren": "/'ʁɔmərən/" }, "language": "dutch" }
headers = { 'Content-Type': 'application/json', 'xi-api-key': '' }
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
with open('output_audio.wav', 'wb') as f: f.write(response.content) print('Audio file saved as output_audio.wav')
else: print(f"Error: {response.status_code}") print(response.json())
I've created a Professional Voice Clone in Dutch. However, when I try to do some lexicon changes through the dictionary, it seems the lexicon only 'speaks' English. This is the code I use:
import requests
api_key = '' voice_id = 'IheMBE86LFF4Xj32yQWB' # Replace with your cloned voice ID url = f'https://api.elevenlabs.io/v1/text-to-speech/IheMBE86LFF4Xj32yQWB'
data = { "voice_id": 'IheMBE86LFF4Xj32yQWB', "text": "Gommeren", "dictionary": { "Gommeren": "/'ʁɔmərən/" }, "language": "dutch"
}
headers = { 'Content-Type': 'application/json', 'xi-api-key': ''
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
Save the output audio file
else: print(f"Error: {response.status_code}") print(response.json())