Discussions
Talks Endpoint with Audio
about 2 years ago by jfri
I'm using the following curl request to generate a talk with audio input:
curl --request POST
--url https://api.d-id.com/talks
--header 'accept: application/json'
--header 'authorization: Basic USER:PASSWD'
--header 'content-type: application/json'
--data '
{
"script": {
"type": "audio",
"ssml": "false",
"reduce_noise": "false",
"audio_url": "AUDIO_URL"
},
"source_url": "IMG_URL"
}
'
As a response I get a "Validation Error" with the following message(s):
Issues: [{"body.script.type":{"message":"should be one of the following; ['text']","value":"audio"},"body.script.input":{"message":"'input' is required"}},{"body.script.audio_url":{"message":"must be a valid https URL to an audio (flac,mp3,mp4,wav,m4a)","value":"AUDIO_URL"}}]
- Why does it tell me that body.script.type needs to be "text", when "audio" is supposed to be used when linking to an audio file as input?
- body.script.input shouldn't be required, since the reference to the audio file is in body.script.audio_url.
- It tells me that the audio URL is invalid, yet if I do 'curl AUDIO_URL -o audio.mp3', audio.mp3 is a valid MP3 file. Is it because the URL does not end in ".mp3"?