我正在尝试使用谷歌语音识别 API。这是我写的代码:
http://pastebin.com/zJEhnJ74
有用。我从服务器得到答案:
{"status":5,"id":"8803471b14a2310dfcf917754e8bd4a7-1","hypotheses":[]}
现在的问题是“状态:5”。事实上,这是状态代码:
status: 0 – correct
, status: 4 – missing audio file,
status: 5 – incorrect audio file.
我的问题是“音频文件不正确”。我不明白这是否是 .flac 文件错误(您可以在此处下载我的测试 .flac 文件:http://www21.zippyshare.com/v/61888405/file.html)或我如何读取文件(在字节数组中然后将其转换为字符串)
感谢帮助!抱歉我的英语不好
你必须使用wr.write(data);
代替wr.writeBytes(new String(data));
谷歌答案:
{"status":0,"id":"e0f4ced346ad18bbb81756ed4d639164-1","hypotheses":[{"utterance":"hello how are you","confidence":0.94028234},{"utterance":"hello how r you"},{"utterance":"hello how are u"},{"utterance":"hello how are you in"}]}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)