- ws api:
ws://{server}:{port}/paddlespeech/asr/streaming
The client sends streaming voice recognition audio information and decoding parameters through the start signal.
{
"name": "test.wav",
"signal": "start",
"nbest": 1
}
The server returns the status of the new connection.
Field | Required | Type | Description |
---|---|---|---|
status | Yes | string | ASR server status |
signal | Yes | string | The streaming connection preparation is complete |
{
"status": "ok",
"signal": "server_ready"
}
The server also needs to save the WAV file.
After the client and server establish a connection, the client continuously sends data to the server.
Send PCM16 data stream to the server.
For each data sent, the server returns the decoding result of that data packet.
Field | Required | Type | Description |
---|---|---|---|
result | Yes | string | ASR decoding result |
After sending the last data packet, the client needs to send an end command to the server to notify the server to destroy the resources associated with that connection.
Inputting Streaming Voice Recognition Audio Information and Decoding Parameters Through the Start Signal
Field | Required | Type | Description |
---|---|---|---|
name | Yes | string | Name of the input audio |
signal | Yes | string | Type of command in streaming recognition |
nbest | Yes | int | Recognition nbest parameter, default is 1 |
{
"name": "test.wav",
"signal": "end",
"nbest": 1
}
After receiving the end information, the server sends back the final result.
Field | Required | Type | Description |
---|---|---|---|
name | Yes | string | Name of the input audio |
signal | Yes | string | Type of command in streaming recognition, as sent |
result | Yes | string | The final recognition result |
{
"name": "test.wav",
"signal": "end",
"result": ""
}