Discussions

Ask a Question
Back to All

Getting error in generating idle video


Here is the snippet that I am sending in request :


import requests

url = "https://api.d-id.com/talks"

payload = {
"script": {
"type": "text",
"subtitles": "false",
"provider": {
"type": "microsoft",
"voice_id": "en-US-JennyNeural"
},
"input": "<break time=\"5000ms\"/><break time=\"5000ms\"/><break time=\"5000ms\"/>",
"ssml": True
},
"config": {
"fluent": True,
"pad_audio": "0.0"
},
"source_url": "https://i.mdel.net/mdx/i/2019/01/2019_01_16_Models.com_15.jpg",
"driver_url": "bank://lively/driver-06"
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer My_Token"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

I am passing all the parameters as same as mentioned in the documentation, then also I am facing the below error :
This error is raising due to passing : "input": "<break time="5000ms"/><break time="5000ms"/><break time="5000ms"/>"

Error :
{
"kind": "TextToSpeechProviderError",
"description": "Missing audio data",
"details": {
"provider": "microsoft",
"event": {
"privResultId": "AB9AFDCC52784205940C4FDB72D9E994",
"privReason": 1,
"privErrorDetails": "'\' is an unexpected token. The expected token is '"' or '''. Line 5, position 25. websocket error code: 1007",
"privProperties": {
"privKeys": [
"CancellationErrorCode"
],
"privValues": [
"BadRequestParameters"
]
}
}
}
}

Please do the needful to resolve my issue.