语音识别无法唤起离线语义功能
のandy 发布于2018-04 浏览:1508 回复:3
0
收藏

mMap = new HashMap<>();
mMap.put(SpeechConstant.DECODER, 2);
mMap.remove(SpeechConstant.PID); // 去除pid,只支持中文
mMap.put(SpeechConstant.NLU, "enable-all");
mMap.put(SpeechConstant.ASR_OFFLINE_ENGINE_GRAMMER_FILE_PATH, "asset:///baidu_speech_grammar.bsg");
mMap.put(SpeechConstant.ACCEPT_AUDIO_VOLUME, false);//不需要音量回调
mMap.putAll(OfflineRecogParams.fetchSlotDataParam(key));
JSONObject json = new JSONObject();
json.put("wakeupkeyword", new JSONArray().put("你好小萌伴")); // 我bsg文件定义的是  语义wakeupkeyword=你好小萌     说法 app.wakeup=
map.put(SpeechConstant.SLOT_DATA, json);
 
这样, 在onEvent回调中,asr.partial数据result_type一直没有nlu_result,  打印结果后,final_result识别的文字是  你好小萌伴, 但是为什么没有nlu_result离线语义识别结果呢?
 
我昨天更新的最新版本。bdasr_V3_20180320_9066860.jar, 5个so文件也都已经导入, 另外, wp唤醒词能正常识别
收藏
点赞
0
个赞
共3条回复 最后由用户已被禁言回复于2022-04
#4yuanfen4062回复于2018-05

同意。官方的地址果然写错了。

0
#3fujiayi1984回复于2018-04

感谢告知,下版本修复

0
#2のandy回复于2018-04

官方demo包中OfflineRecogParams的fetchOfflineParams方法 assets地址写错了,少了 s, 我复制过来就跟着悲剧了

希望改下,以防更多人出现该问题

0
TOP
切换版块