def get_dubbed_audio(transcription, language, voice_name):
url = "https://elevenlabs-dubbing1.p.rapidapi.com/dubbing"
payload = {
"audio_duration_seconds": 47.809886621315194,
"elevenlabs_api_key": elevenlabs_key,
"spoken_language": language,
"transcription": transcription,
"voice_name": voice_name
}
headers = {
"content-type": "application/json",
"X-RapidAPI-Key": "...",
"X-RapidAPI-Host": "elevenlabs-dubbing1.p.rapidapi.com"
}
response = requests.post(url, json=payload, headers=headers)
return response
Am I doing something wrong?
Junte-se à discussão - adicione o comentário abaixo:
The only error I can see is that you define the “voice_name” key in the playload, which hasn’t existed for a few days. Please replace the value of the key with “voice_id” and set it to the id of a voice (available in the json file of the enpoint /get_voices or at the end of the documentation page).
payload = {
“audio_duration_seconds”: 47.809886621315194,
“elevenlabs_api_key”: elevenlabs_key,
“spoken_language”: language,
“transcription”: transcription,
“voice_id”: voice_id
}
(Note that this allows you to use the API key of your elevenlabs account to access a wider range of voices than those indicated in the json file of available voices. Internal server error may occur for other reasons: please check that the value of each is indicated as requested.)