Updated on 2025-08-26 GMT+08:00

Event Responses

After detecting certain events, the server sends corresponding responses (JSON character strings) in text messages.

Response

Table 1 Response parameters

Parameter

Type

Description

resp_type

String

Response type. The value of this parameter is EVENT, indicating the response to a recognition starting request.

trace_id

String

Service internal token used to trace a specific process in logs

event

String

For detailed events, see Value Range and Description of Parameter event.

timestamp

Integer

This is a reserved field. It will be used to indicate the time when an event occurs. The start time of a speech is 00:00. The unit is ms.

Value Range and Description of Parameter event

Table 2 Value range of event

Event

Description

VOICE_START

Detects the start of a sentence.

VOICE_END

Detects the end of a sentence.

EXCEEDED_SILENCE

The mute duration is too long, that is, no sound is detected during a certain time period.

  • In streaming mode:
    • The VOICE_START, VOICE_END, and EXCEEDED_SILENCE events are not returned.
  • In single-sentence mode:
    • When the VOICE_START event is returned, speech is detected and the IVR system can interrupt the recognition.
    • After the VOICE_END event is returned, the recognition of a sentence ends and subsequent audio segments will be ignored.
    • Only one set of VOICE_START and VOICE_END events will be returned.
    • If the EXCEEDED_SILENCE event is returned, no sound is detected during the period specified by vad_head. That is, the user did not speak. Then, subsequent audio segments will be ignored.
  • In continuous mode:
    • The VOICE_START, VOICE_END, and EXCEEDED_SILENCE events are not returned.

Example

{
  "resp_type": "EVENT",
  "trace_id": "567e8537-a89c-13c3-a882-826321939651",
  "event": "VOICE_END",
  "timestamp": 1500
}

Status Code

For details about status codes, see Status Codes.

Error Code

For details about error codes, see Error Codes.