Skip to content

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-TypestringRequired
    Enum
    application/json
  • AuthorizationstringRequired
    Bearer authentication format, for example: Bearer

Request Body Parameters

  • fileUrlstringRequired
    URL of the file for video translation.
  • sourceLangstringRequired
    The source language of the video that needs to be translated.
    • enEnglish
    • zhChinese
    • esSpanish
  • targetLangstringRequired
    The target language of the video that needs to be translated.
    • enEnglish
    • zhChinese
    • esSpanish

Response

  • codeinteger
    0 success, or error code.
  • messagestring
    "success", or error msg.
  • dataobject
    taskIdstring
    Use 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.