http方式接入语音识别,得到的response的result为SUCCESS,但是没有识别结果。

按照文档https://developer.rokid.com/docs/3-ApiReference/mapi-doc/gw-http-asr-api.html所说,响应结果里应该有6项(asr、scores、result等),但是我得到的响应却是下面这样子的。 { “id”: 1, “type”: “COMPLETED”, “result”: “SUCCESS” }

用的语言是python,核心的代码如下 audio_path = r’F:\workspaces\qudian\asr_test\short\cn_8k_16bit_1ch\BAC009S0724W0129.wav’ asr_request = RokidAsrRequest_pb2.AsrRequest() asr_request.id = 1 asr_request.type = ‘ONESHOT’ asr_request.voices = open(audio_path, ‘rb’).read()

response = requests.post(URL, data=asr_request.SerializeToString(), headers=headers) print(response.json())

代码乱了,重新发一次 audio_path = r’F:\workspaces\qudian\asr_test\short\cn_8k_16bit_1ch\BAC009S0724W0129.wav’

asr_request = RokidAsrRequest_pb2.AsrRequest()

asr_request.id = 1

asr_request.type = ‘ONESHOT’

asr_request.voices = open(audio_path, ‘rb’).read()

response = requests.post(URL, data=asr_request.SerializeToString(), headers=headers)

print(response.json())