Android 真机语音识别失败
来源:15-11 Flutter AI智能语音搜索功能实现【锦上添花】
Dante2009
2021-03-24
对比了下 看不出区别 老师能帮看下嘛 (包名和项目一致用的项目的APPID)
I/AsrManager.Debug(32672): 识别参数(反馈请带上此行日志){}
E/ASREngine(32672): VAD Model=dnn
I/[BDASR_LOG] Policy(32672): use custom galaxy = false
D/Device (32672): read deviceID:65016AA7E2E8E5DE25E33ED8F16BA971|814832140759368
I/AsrManager(32672): 停止录音
I/[BDASR_LOG] MicrophoneServer(32672): add wrap socket, mRemoteOutputStreams size = 1 firstStart = true
I/BDSHttpRequestMaker(32672): url = https://vop.baidu.com/v2/up?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &b6ecd4f,
D/BDSHttpRequestMaker(32672): url: https://vop.baidu.com/v2/up?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb mHostIp: vop.baidu.com &b6ecd4f,
W/AudioSystem(32672): (gLock) AudioSystem start get_audio_flinger()
W/AudioSystem(32672): (gLock) AudioSystem end get_audio_flinger()ms: 0ms
V/ASREngine(32672): ASRCallBack :0
I/RecogEventAdapter(32672): name:asr.ready; params:{“pid”:1536,“sn”:“fd3c8979-8c03-494d-ac07-a9643b2442fb”}
V/ASREngine(32672): ASRCallBack :16
V/ASREngine(32672): ASRCallBack :2
I/RecogEventAdapter(32672): name:asr.end; params:{“vad_silent_start”:“1616573805497”}
W/AudioSystem(32672): (gLock) AudioSystem start get_audio_flinger()
W/AudioSystem(32672): (gLock) AudioSystem end get_audio_flinger()ms: 0ms
I/[BDASR_LOG] audioSource : (32672): 1
I/[BDASR_LOG] MicInputStream(32672): startRecordingAndCheckStatus recorder status is 1
I/AudioRecord(32672): setBlueToothScoState() state:3, audiosource:1
D/BDSHttpRequestMaker(32672): hostname : vop.baidu.com verifyUrl : vop.baidu.com &b6ecd4f,
I/BDSHttpRequestMaker(32672): url = https://vop.baidu.com/v2/down?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &ab454ba,
D/BDSHttpRequestMaker(32672): url: https://vop.baidu.com/v2/down?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb mHostIp: vop.baidu.com &ab454ba,
D/BDSHttpRequestMaker(32672): hostname : vop.baidu.com verifyUrl : vop.baidu.com &ab454ba,
I/BDSHttpRequestMaker(32672): AudioData : mType = 3 | mIsLast = true | mData = 5 &ab454ba,
I/BDSHttpRequestMaker(32672): DownloadThread mData[0] = 1 &ab454ba,
I/BDSHttpRequestMaker(32672): DownloadThread mData[1] = 0 &ab454ba,
I/BDSHttpRequestMaker(32672): DownloadThread mData[2] = 0 &ab454ba,
I/BDSHttpRequestMaker(32672): DownloadThread mData[3] = 0 &ab454ba,
I/BDSHttpRequestMaker(32672): DownloadThread mData[4] = 3 &ab454ba,
I/BDSHttpRequestMaker(32672): sendData dataType : 0 https://vop.baidu.com/v2/up?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &b6ecd4f,
I/BDSHttpRequestMaker(32672): sendData dataType : 3 https://vop.baidu.com/v2/up?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &b6ecd4f,
I/HwAudioRecordImpl(32672): sendStateChangedIntent, state=3
I/BDSHttpRequestMaker(32672): readData dataType : 244 https://vop.baidu.com/v2/down?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &ab454ba,
I/MicrophoneServer(32672): audio mills is 0
V/ASREngine(32672): ASRCallBack :6
I/BDSHttpRequestMaker(32672): readData dataType : 248 https://vop.baidu.com/v2/down?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &ab454ba,
I/BDSHttpRequestMaker(32672): response : {“gather_suspected”:false,“gather_suspected_int”:0,“gather_type”:0,“gather_wake”:false,“gather_wake_int”:0,“multi_vad_end_mode”:1,“suspected_cache”:0,“suspected_upload”:0,“vad_end_mode”:1}
I/BDSHttpRequestMaker(32672): https://vop.baidu.com/v2/down?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &ab454ba,
W/System.err(32672): java.util.concurrent.ExecutionException: java.io.IOException: Broken pipe
W/System.err(32672): at java.util.concurrent.FutureTask.report(FutureTask.java:123)
W/System.err(32672): at java.util.concurrent.FutureTask.get(FutureTask.java:207)
W/System.err(32672): at com.baidu.speech.audio.MicrophoneServer.run(Unknown Source:94)
W/System.err(32672): at java.lang.Thread.run(Thread.java:929)
W/System.err(32672): Caused by: java.io.IOException: Broken pipe
W/System.err(32672): at android.net.LocalSocketImpl.writeba_native(Native Method)
W/System.err(32672): at android.net.LocalSocketImpl.access500(LocalSocketImpl.java:37)W/System.err(32672):atandroid.net.LocalSocketImpl500(LocalSocketImpl.java:37)
W/System.err(32672): at android.net.LocalSocketImpl500(LocalSocketImpl.java:37)W/System.err(32672):atandroid.net.LocalSocketImplSocketOutputStream.write(LocalSocketImpl.java:147)
W/System.err(32672): at com.baidu.speech.audio.MicrophoneServer$2.call(Unknown Source:17)
W/System.err(32672): at com.baidu.speech.audio.MicrophoneServer2.call(UnknownSource:0)W/System.err(32672):atjava.util.concurrent.FutureTask.run(FutureTask.java:266)W/System.err(32672):atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)W/System.err(32672):atjava.util.concurrent.ThreadPoolExecutor2.call(Unknown Source:0)
W/System.err(32672): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err(32672): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err(32672): at java.util.concurrent.ThreadPoolExecutor2.call(UnknownSource:0)W/System.err(32672):atjava.util.concurrent.FutureTask.run(FutureTask.java:266)W/System.err(32672):atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)W/System.err(32672):atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:641)
W/System.err(32672): … 1 more
I/[BDASR_LOG] MicrophoneServer(32672): finally, mRemoteOutputStreams size = 0 firstStart = true
I/AudioRecord(32672): setBlueToothScoState() state:1, audiosource:1
I/BDSHttpRequestMaker(32672): readData dataType : 241 https://vop.baidu.com/v2/down?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &ab454ba,
I/BDSHttpRequestMaker(32672): response : {“corpus_no”:6943131623577901550,“err_msg”:“asr server not find effective speech[info: 1011]”,“err_no”:-3005,“sn”:“fd3c8979-8c03-494d-ac07-a9643b2442fb”}
I/BDSHttpRequestMaker(32672): https://vop.baidu.com/v2/down?sn=fd3c8979-8c03-494d-ac07-a9643b2442fb &ab454ba,
V/ASREngine(32672): ASRCallBack :8
I/BDSHttpRequestMaker(32672): Exception &ab454ba,
E/ASREngine(32672): EVoiceRecognitionClientWorkStatusError errorDomain : 33 errorCode : -3005 desc : Server speech quality problem. mLastRecognitionResult:
W/System.err(32672): java.lang.NullPointerException: Attempt to invoke virtual method ‘java.net.URL java.net.HttpURLConnection.getURL()’ on a null object reference
D/ASREngine(32672): generateErrorResult errDomain = 33 errCode = -3005
W/System.err(32672): at com.baidu.speech.core.BDSHttpRequestMaker.readData(Unknown Source:154)
I/RecogEventAdapter(32672): name:asr.finish; params:{“origin_result”:{“sn”:"",“error”:7,“desc”:“No recognition result match”,“sub_error”:7001},“error”:7,“desc”:“No recognition result match”,“sub_error”:7001}
E/RecogEventAdapter(32672): asr error:{“origin_result”:{“sn”:"",“error”:7,“desc”:“No recognition result match”,“sub_error”:7001},“error”:7,“desc”:“No recognition result match”,“sub_error”:7001}
I/HwAudioRecordImpl(32672): sendStateChangedIntent, state=1
V/ASREngine(32672): ASRCallBack :18
W/AudioSystem(32672): (gLock) AudioSystem start get_audio_flinger()
W/AudioSystem(32672): (gLock) AudioSystem end get_audio_flinger()ms: 0ms
I/RecogEventAdapter(32672): name:asr.exit; params:null
I/flutter (32672): ----------PlatformException(No recognition result match, null, null, null)
I/AsrManager(32672): 停止录音
1回答
-
CrazyCodeBoy
2021-03-26
是不是没有申请录音的权限呢,参考下百度SDK的官方文档添加下对应权限。
012021-04-01
相似问题