[DYMTLInitPlatform] platform initialization successful
2018-01-04 19:22:39.540456+0800 baiduASR[10204:3040131] Current SDK version: 3.0.5.5
ERROR:[/Users/lixi13/Desktop/baidu-speech-sdk-icode-master/core/VAD/MFE/dnn/dnn_vad.cpp:291]NULL POINTER: dnnfile=,cmvn=
2018-01-04 19:22:39.601459+0800 baiduASR[10204:3040131] 发生错误 Error Domain=20 Code=1310721 "VAD start: start error." UserInfo={NSLocalizedDescription=VAD start: start error., NSHelpAnchor=640EA577-074D-47D1-9B31-91478673CA73}
2018-01-04 19:22:39.636066+0800 baiduASR[10204:3040282] [setAudioCategoryWithError] check category
2018-01-04 19:22:39.637611+0800 baiduASR[10204:3040282] [setAudioCategoryWithError] reset category from: AVAudioSessionCategorySoloAmbient to: AVAudioSessionCategoryPlayAndRecord.
出现这个问题的原因是没有在资源文件中导入bds_easr_basic_model.dat
在configModelVAD方法后调用 启动识别函数
可在configVoiceRecognitionClient
// 发送指令:启动识别
[self.asrEventManager sendCommand:BDS_ASR_CMD_START];
才能正常使用语音识别功能
- (void)configVoiceRecognitionClient {
//设置DEBUG_LOG的级别
[self.asrEventManager setParameter:@(EVRDebugLogLevelTrace) forKey:BDS_ASR_DEBUG_LOG_LEVEL];
//配置API_KEY 和 SECRET_KEY 和 APP_ID
[self.asrEventManager setParameter:@[API_KEY, SECRET_KEY] forKey:BDS_ASR_API_SECRET_KEYS];
[self.asrEventManager setParameter:APP_ID forKey:BDS_ASR_OFFLINE_APP_CODE];
//配置端点检测(二选一)
[self configModelVAD];
// [self configDNNMFE];
// [self.asrEventManager setParameter:@"15361" forKey:BDS_ASR_PRODUCT_ID];
// ---- 语义与标点 -----
[self enableNLU];
// [self enablePunctuation];
// ------------------------
}
- (void) enableNLU {
// ---- 开启语义理解 -----
[self.asrEventManager setParameter:@(YES) forKey:BDS_ASR_ENABLE_NLU];
[self.asrEventManager setParameter:@"15361" forKey:BDS_ASR_PRODUCT_ID];
}
- (void)configModelVAD {
NSString *modelVAD_filepath = [[NSBundle mainBundle] pathForResource:@"bds_easr_basic_model" ofType:@"dat"];
[self.asrEventManager setParameter:modelVAD_filepath forKey:BDS_ASR_MODEL_VAD_DAT_FILE];
[self.asrEventManager setParameter:@(YES) forKey:BDS_ASR_ENABLE_MODEL_VAD];
}
是因为虽然加进去.dat文件 但是没有调用。。。