logo
On this page

Drive Digital Human By Text


Description

Through this API, you can make the digital human speak the specified input text.

Request prototype

  • Request method: POST
  • Request body format: JSON
  • Request URL: https://aigc-digitalhuman-api.zegotech.cn?Action=DriveByText
  • Transmission protocol: HTTPS
  • QPS limit: 10 times/second

Request Parameters

The following request parameter list only shows the API request parameters and some common parameters. For the complete list of common parameters, please refer to Accessing Server APIs - Common Request Parameters.

ParameterTypeRequiredDescription
TaskIdStringYesDigital human video stream task ID. You can obtain it from the response parameters of the CreateDigitalHumanStreamTask API.
TextStringYesText content to be spoken. Maximum 1800 characters.
InterruptModeNumberNoWhether to interrupt the running speaking task and immediately execute this task. Optional values:
  • 0 (default): No, queue and wait for the previous task to complete before executing.
  • 1: Yes, immediately interrupt the current task to execute this task.
TTSConfigObjectYesTTS configuration. For details, please refer to TTSConfig.

TTSConfig

ParameterTypeRequiredDescription
TimbreIdStringYesTimbre ID. You can obtain it from the response parameters of the GetTimbreList API.
SpeechRateNumberNoSpeech rate. Range is [-500, 500]. If not specified, the default value is 0. The larger the value, the faster the speech rate.
PitchRateNumberNoPitch. Range is [-500, 500]. If not specified, the default value is 0. The larger the value, the higher the pitch.
VolumeNumberNoVolume. Range is [1, 100]. If not specified, the default value is 50. The larger the value, the louder the sound.

Sample request

  • Request URL:

    https://aigc-digitalhuman-api.zegotech.cn?Action=DriveByText
    &<Common Request Parameters>
  • Request body:

    {
        "TaskId": "f06d1f5d-c0d1-4845-9a2c-f0a45ee037fd",
        "Text": "xxx",
        "TTSConfig": {
            "Volume": 51,
            "SpeechRate": 51,
            "PitchRate": 51,
            "TimbreId": "xxx"
        },
        "InterruptMode": 1
    }

Response parameters

ParameterTypeDescription
CodeNumberReturn code. 0 indicates success, other values indicate failure. For error codes and response handling suggestions, please refer to Return Codes.
MessageStringDescription of the request result.
RequestIdStringRequest ID.
└DriveIdStringDigital human video stream driving task ID.

Sample response

{
    "Code": 0,
    "Message": "success",
    "RequestId": "e6f95291-7053-4c87-9bd0-b4b8c56aabfd",
    "Data": {
        "DriveId": "ae8c4d88-44fe-469a-aedf-df06849d0fdc"
    }
}

Previous

Drive Digital Human By RTC Audio Stream

Next

Get WebSocket Drive Information