logo
On this page

Get WebSocket Drive Information


Description

Through this API, you can obtain a WebSocket connection address. By transmitting PCM audio data to this address, you can drive the digital human to speak.

For the complete WebSocket digital human driving process, please refer to Drive Digital Human Speech via WebSocket.

Note

When transmitting audio stream via Websocket to drive the digital human to speak, the digital human's current driving task will be interrupted by default and the queued driving tasks will be discarded.

Request prototype

  • Request method: POST
  • Request body format: JSON
  • Request URL: https://aigc-digitalhuman-api.zegotech.cn?Action=DriveByWsStream
  • 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.

Sample request

  • Request URL:

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

    {
        "TaskId": "c54ffce5-e63c-414f-9342-b0777ae8e691"
    }

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.
└WssAddressStringWebSocket connection address related to the digital human video stream task. After establishing a connection with the digital human API server through this address, you can transmit PCM audio data to drive the digital human to speak.

Sample response

{
    "Code": 0,
    "Message": "success",
    "RequestId": "9f5228e2-2c90-4faa-aa7e-7ebbf28bbd83",
    "Data": {
        "DriveId": "9b9c09ef-281d-43d8-807f-e00e71049642",
        "WssAddress": "wss://xx.xx.xx.xx:xxx/ws?Token=xxxx"
    }
}

Previous

Drive Digital Human By Text

Next

Get Digital Human Video Stream Task Status