Send TTS Command

Last Updated on : 2023-06-15 05:19:44

Send a text to speech (TTS) command to a device. Then, the device plays the audio based on the input text.

API address

POST: /v1.0/aispeech/voice/push

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
ttsString falseThe text.
audio_urlString falseThe URL of a specified audio file.
tts_urlString falseThe URL of a specified TTS file. tts_url, tts_url_method, and tts_url_param work together to get the audio content.
tts_url_methodString falseThe request method of a specified TTS file.
tts_url_paramString falseThe TTS request parameter, which can be customized as needed.
deviceIdString falseThe device ID.

Return parameter

Parameter nameTypeDescription
resultVoicePushRespThe returned result.

Description of result

Parameter nameTypeDescription
error_codeStringThe error code.
is_successBooleanIndicates whether the operation of sending a TTS command is successful.
error_msgStringThe error message.

Request example

POST: /v1.0/aispeech/voice/push
{
  "tts": "TTS test",
  "deviceId": "6c5f0f0b5****vabt"
}

Return example

{
    "tid": "bc5c849aa36b11ecbe82ba2dd9681f11",
    "result": {
        "isSuccess": true
    },
    "t": 1647244366294,
    "success": true
}

Error code

For more information, see error code.