Client events are WebSocket commands that the client sends to the Fun-ASR real-time speech recognition service: run-task starts a recognition task, continue-task updates the conversation context, and finish-task ends it. Each section below describes the message structure and field semantics of one event.
User guide: For model details and selection guidance, see Speech-to-text.
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.
|
header |
Basic request
With context
|
|
payload |
continue-task
Description: Updates the conversation context during an active recognition task to improve recognition accuracy.
When to send: During an active task, when you need to update the conversation context.
Only the fun-asr-realtime and fun-asr-realtime-2025-11-07 models support this event.
|
header |
|
|
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.
|
header |
|
|
payload |