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

Ending Recognition

Function

To cancel or end the recognition of a speech being recognized, the client needs to send a "recognition ending" request over WebSocket. The "recognition ending" request is sent in a text message. The commands and parameters are in JSON character strings.

Request

Table 1 Parameters

Parameter

Mandatory

Type

Description

command

Yes

String

Indicates that the client ends the recognition request. Set this parameter to END.

cancel

No

Boolen

Indicates whether to cancel the return of the recognition result.

  • true: Indicates that the recognition is canceled, that is, the audio data being recognized and to be recognized is discarded and the remaining results are not returned.
  • false: Continues to process the audio data being recognized and to be recognized until all input data is processed.

    Default value: false

Example

{
  "command": "END",
  "cancel": false
}

Status Code

For details about status codes, see Status Codes.

Error Code

For details about error codes, see Error Codes.