WebSocket client event reference for Fun-ASR real-time speech recognition
Client events are WebSocket commands that the client sends to the Fun-ASR real-time speech recognition service:
Description: Starts a speech recognition task. Sets the model, audio format, sample rate, and other parameters.
When to send: Immediately after the WebSocket connection is established.
Response: The client can send audio only after the service returns a task-started event.
Description: Notifies the service that all audio has been sent and requests that the service finish the task.
When to send: After all audio data has been sent.
Response: The service returns a task-finished event.
run-task starts a recognition task, and finish-task ends it.
User guide: For model details and selection guidance, see Speech-to-text models.
Event sequence: For the event interaction diagram, see WebSocket API.
run-task
Description: Starts a speech recognition task. Sets the model, audio format, sample rate, and other parameters.
When to send: Immediately after the WebSocket connection is established.
Response: The client can send audio only after the service returns a task-started event.
Example
object
body
required
Message header.
object
body
required
Message payload.
finish-task
Description: Notifies the service that all audio has been sent and requests that the service finish the task.
When to send: After all audio data has been sent.
Response: The service returns a task-finished event.
Example
object
body
required
Message header.
object
body
required
Message payload.