Video Translate(Only-Voice)
POST https://api.newportai.com/api/async/video_translate_only_voice
Translate the audio in the video from the source language to the target language.
Request Header Parameters
- Content-TypestringRequiredEnumapplication/json
- AuthorizationstringRequiredBearer authentication format, for example: Bearer
Request Body Parameters
- fileUrlstringRequiredURL of the file for video translation.
- sourceLangstringRequiredThe source language of the video that needs to be translated.
- enEnglish
- zhChinese
- esSpanish
- targetLangstringRequiredThe target language of the video that needs to be translated.
- enEnglish
- zhChinese
- esSpanish
Response
- codeinteger0 success, or error code.
- messagestring"success", or error msg.
- dataobjecttaskIdstringUse the taskId to request the getAsyncResult API to retrieve the generated outputs.
Example
Drive video translate.
Request:
zsh
curl -X POST 'https://api.newportai.com/api/async/video_translate_only_voice' \
-H 'Authorization: {{key}}' \
-H 'Content-Type: application/json' \
-d '{
"fileUrl": "https://dreamapi-oss.oss-cn-hongkong.aliyuncs.com/demo/2024-11-22/6WiaA5XO1733281141269.mp4",
"sourceLang": "zh",
"targetLang":"en"
}'
Response:
json
{
"code": 0,
"message": "success",
"data": {
"taskId": "{{taskId}}"
}
}
Next Step:
Use Polling API to get the result.