Skip to content

Talking Face

POST https://api.newportai.com/api/async/talking_face

Talking Face API could generate a talking avatar from audio and video. The talking avatar is capable of mirroring the facial expressions and vocal tone of a real person,while supporting multiple languages.

  • Use Talking Face API to get taskId with POST method.
  • Use Polling API to get Talking Face result with POST method.

Request Header Parameters

  • Content-TypestringRequired
    Enum
    application/json
  • AuthorizationstringRequired
    Bearer authentication format, for example: Bearer

Request Body Parameters

  • vocalAudioUrlstring
  • srcVideoUrlstringRequired
    video url.
  • audioUrlstringRequired
    original audio url.
  • videoParamsObject
    video_widthintegerRequired
    The video_width parameter determines the width of the output video. If video_width is set to 0, the generated video will retain the same width as the source video.
    video_heightintegerRequired
    The video_height parameter determines the height of the output video. If video_height is set to 0, the generated video will retain the same height as the source video.
    video_enhanceintegerRequired
    The video_enhance parameter improves the clarity and sharpness of faces in the video: 0 for no, 1 for yes.

Response

  • codeinteger
    0 success, or error code.
  • messagestring
    "success", or error msg.
  • dataobject
    taskIdstring
    Use the taskId to request the Polling API to retrieve the generated outputs.

Example

Request:

zsh
curl -X POST 'https://api.newportai.com/api/async/talking_face' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
-d '{
  "srcVideoUrl": "https://newportai-api-market.s3.amazonaws.com/demo_audio/video_demo.mp4",
  "audioUrl": "https://newportai-api-market.s3.amazonaws.com/demo_audio/audio_demo.mp3",
  "videoParams": {
    "video_width": 0,
    "video_height": 0,
    "video_enhance": 1
  }
}'

Response:

json
{
  "code": 0,
  "message": "success",
  "data": {
    "taskId": "b08337dc08d7428daa64b3d5e61b8350"
  }
}

Next Step:

Use Polling API to get the result.

Demo