更新时间:2025-08-26 GMT+08:00
识别结果响应
服务端在收到客户端发送的连续音频数据后, 当服务端识别出结果后会实时向客户端按句推送识别结果响应消息, 以json字符串形式放置在text message中。
响应消息
参数名 |
参数类型 |
说明 |
---|---|---|
resp_type |
String |
响应类型。参数值为RESULT,表示识别结果响应。 |
trace_id |
String |
服务内部的令牌,可用于在日志中追溯具体流程。 |
segments |
Array of objects |
多句结果。 请参考表 segment 数据结构。 |
参数名 |
参数类型 |
说明 |
---|---|---|
start_time |
Integer |
相对时间戳,表示一句的起始,单位为ms。 |
end_time |
Integer |
相对时间戳,表示一句的结束,单位为ms。 |
is_final |
Boolen |
输出是否为最终结果。 true表示是最终结果, false表示为中间临时结果。 |
result |
Object |
调用成功表示识别结果,调用失败时无此字段。 请参考表 result数据结构。 |
示例
{ "resp_type": "RESULT", "trace_id": "b08a4603-3e1a-4f30-ae07-b2bbabe2e8d7", "segments": [ { "start_time": 0, "end_time": 3159, "is_final": true, "result": { "text": "hello everybody", "score": 0.9178787469863892, "word_info": [ { "start_time": 920, "end_time": 1200, "word": "▁HE" }, { "start_time": 1200, "end_time": 1380, "word": "LL" }, { "start_time": 1380, "end_time": 1500, "word": "O" }, { "start_time": 1580, "end_time": 2040, "word": "▁EVERYBODY" } ] } } ] }
状态码
状态码请参见状态码。
错误码
错误码请参见错误码。
父主题: 实时语音识别响应