Leautolink:
我使用的服务是:语音识别服务
调用的接口是:
asr.send(SpeechConstant.ASR_START, json, null, 0, 0);
参数设置情况:
params.put(SpeechConstant.NLU, "enable");
params.put(SpeechConstant.ACCEPT_AUDIO_VOLUME, false);
params.put(SpeechConstant.VAD, SpeechConstant.VAD_DNN);
params.put(SpeechConstant.SOUND_START, R.raw.start_tone);
params.put(SpeechConstant.PID, 15361);
params.put(SpeechConstant.ACCEPT_AUDIO_DATA, true);
params.put(SpeechConstant.IN_FILE,
"#com.leautolink.multivoiceengins.engine.stt.stream.VoiceInputStream"
+ ".create16kStream()");
开发平台和机型:android
SDK版本号:3.0.3
代码或日志截图(上传截图能帮助您更快解决问题):
复现步骤、现象及其他描述:
通过另一设备将pcm数据,通过流的方式写入VoiceInputStream(是继承InputStream)的,在SpeechConstant.ASR_START的参数里添加inputFile的类型为
"#com.leautolink.multivoiceengins.engine.stt.stream.VoiceInputStream"
+ ".create16kStream()"
,从log看也一直在读:
10-27 17:46:16.575 I/XXX (21684): --->read: com.leautolink.multivoiceengins.engine.stt.stream.VoiceInputStream@356851a buffer.length: 1920000 thread id =2864
但没有识别出传过来的pcm.
最后返回:
10-27 17:46:30.374 I/XXX (21684): --->read: com.leautolink.multivoiceengins.engine.stt.stream.VoiceInputStream@356851a buffer.length: 1920000 thread id =2864
10-27 17:46:30.387 I/BaiduSTTEngine(21684): onEvent---- params : {"origin_result":{"sn":"","error":2,"desc":"Network is not available","sub_error":2100},"error":2,"desc":"Network is not available","sub_error":2100}
10-27 17:46:30.394 I/XXX (21684): --->read: com.leautolink.multivoiceengins.engine.stt.stream.VoiceInputStream@356851a size: 0
请问两个问题:
1、InputStream读取有什么要求,之前我们发现读取的byteCount 为3200,现在改为3.0.3版本发现这个值为640了,不知道目前变化了,我们给buffer的时候有什么限制?
2、为何我直接将inputstrem用文件打开赋值为InputStream的方式可以识别,且没看到去调用read的方法,而我采用流的方式向inputstrem里面write数据,就看到有过来调取read,但没有识别?