集成语音报错

来源:15-9 Flutter AI智能语音界面开发-1【收获果实】

MR七师弟

2019-04-10

图片描述
老师, 我集成Native语音报错, 代码是课程中的老师的代码, 配置是根据课程配置的, 百度语音的Key是我自己申请的。 看不明白这是哪里的错误。

写回答

2回答

不悔有你ii

2019-04-25

Initializing hot reload...
Syncing files to device Custom Phone...
Reloaded 5 of 583 libraries in 810ms.
I/AsrManager.Debug( 3820): 识别参数(反馈请带上此行日志){}
E/ASREngine( 3820): VAD Model=dnn
I/[BDASR_LOG] Policy( 3820): use custom galaxy = false
D/Device  ( 3820): read deviceID:3856402EB386595AC4E8A4E55E9F8196|000000000000000
I/[BDASR_LOG] MicrophoneServer( 3820): add wrap socket, mRemoteOutputStreams size = 1 firstStart = true
I/BDSHttpRequestMaker( 3820): url = http://vop.baidu.com/v2/up?sn=dc0e6ec0-78ff-4711-9c1d-91e64dff9e17 &78db116, 
D/BDSHttpRequestMaker( 3820): url: http://vop.baidu.com/v2/up?sn=dc0e6ec0-78ff-4711-9c1d-91e64dff9e17 mHostIp: vop.baidu.com &78db116, 
V/ASREngine( 3820): ASRCallBack :0
I/RecogEventAdapter( 3820): name:asr.ready; params:{"pid":1536,"sn":"dc0e6ec0-78ff-4711-9c1d-91e64dff9e17"}
W/System.err( 3820): java.io.IOException: Cleartext HTTP traffic to vop.baidu.com not permitted
W/System.err( 3820): 	at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupUploadConnection(Unknown Source:101)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupConnection(Unknown Source:120)
W/System.err( 3820): java.io.IOException: Cleartext HTTP traffic to 119.75.222.172 not permitted
W/System.err( 3820): 	at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupUploadConnection(Unknown Source:101)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupUploadConnection(Unknown Source:119)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupConnection(Unknown Source:120)
I/[BDASR_LOG] audioSource : ( 3820): 1
I/[BDASR_LOG] MicInputStream( 3820): startRecordingAndCheckStatus recorder status is 1
W/System.err( 3820): java.io.IOException: Cleartext HTTP traffic to 182.61.62.25 not permitted
W/System.err( 3820): 	at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupUploadConnection(Unknown Source:101)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupUploadConnection(Unknown Source:119)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupUploadConnection(Unknown Source:119)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupConnection(Unknown Source:120)
I/BDSHttpRequestMaker( 3820): url = http://vop.baidu.com/v2/down?sn=dc0e6ec0-78ff-4711-9c1d-91e64dff9e17 &c2bc8a2, 
D/BDSHttpRequestMaker( 3820): url: http://vop.baidu.com/v2/down?sn=dc0e6ec0-78ff-4711-9c1d-91e64dff9e17 mHostIp: vop.baidu.com &c2bc8a2, 
W/System.err( 3820): java.io.IOException: Cleartext HTTP traffic to vop.baidu.com not permitted
W/System.err( 3820): 	at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupDownloadConnection(Unknown Source:101)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupConnection(Unknown Source:137)
W/System.err( 3820): java.io.IOException: Cleartext HTTP traffic to 119.75.222.172 not permitted
W/System.err( 3820): 	at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupDownloadConnection(Unknown Source:101)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupDownloadConnection(Unknown Source:208)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupConnection(Unknown Source:137)
W/System.err( 3820): java.io.IOException: Cleartext HTTP traffic to 182.61.62.25 not permitted
W/System.err( 3820): 	at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupDownloadConnection(Unknown Source:101)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupDownloadConnection(Unknown Source:208)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupDownloadConnection(Unknown Source:208)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.setupConnection(Unknown Source:137)
I/BDSHttpRequestMaker( 3820): sendData  dataType : 0 http://182.61.62.25/v2/up?sn=dc0e6ec0-78ff-4711-9c1d-91e64dff9e17 &78db116, 
W/System.err( 3820): java.io.IOException: Cleartext HTTP traffic to 182.61.62.25 not permitted
W/System.err( 3820): 	at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:458)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
W/System.err( 3820): 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:258)
W/System.err( 3820): 	at com.baidu.speech.core.BDSHttpRequestMaker.sendData(Unknown Source:92)
V/ASREngine( 3820): ASRCallBack :8
E/ASREngine( 3820): EVoiceRecognitionClientWorkStatusError errorDomain : 32 errorCode : 2004 desc : HTTP error: 2004 mLastRecognitionResult: 
D/ASREngine( 3820): generateErrorResult errDomain = 32 errCode = 2004
I/MicrophoneServer( 3820): audio mills is 0
V/ASREngine( 3820): ASRCallBack :18
I/RecogEventAdapter( 3820): name:asr.finish; params:{"origin_result":{"sn":"","error":2,"desc":"Download network connect failed","sub_error":2004},"error":2,"desc":"Download network connect failed","sub_error":2004}
E/RecogEventAdapter( 3820): asr error:{"origin_result":{"sn":"","error":2,"desc":"Download network connect failed","sub_error":2004},"error":2,"desc":"Download network connect failed","sub_error":2004}
I/RecogEventAdapter( 3820): name:asr.exit; params:null
I/flutter ( 3820): 错误了呀PlatformException(Download network connect failed, null, null)
W/System.err( 3820): java.util.concurrent.ExecutionException: java.io.IOException: Broken pipe
W/System.err( 3820): 	at java.util.concurrent.FutureTask.report(FutureTask.java:123)
W/System.err( 3820): 	at java.util.concurrent.FutureTask.get(FutureTask.java:207)
W/System.err( 3820): 	at com.baidu.speech.audio.MicrophoneServer.run(Unknown Source:94)
W/System.err( 3820): 	at java.lang.Thread.run(Thread.java:764)
W/System.err( 3820): Caused by: java.io.IOException: Broken pipe
W/System.err( 3820): 	at android.net.LocalSocketImpl.writeba_native(Native Method)
W/System.err( 3820): 	at android.net.LocalSocketImpl.access$500(LocalSocketImpl.java:36)
W/System.err( 3820): 	at android.net.LocalSocketImpl$SocketOutputStream.write(LocalSocketImpl.java:144)
W/System.err( 3820): 	at com.baidu.speech.audio.MicrophoneServer$2.call(Unknown Source:17)
W/System.err( 3820): 	at com.baidu.speech.audio.MicrophoneServer$2.call(Unknown Source:0)
W/System.err( 3820): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err( 3820): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err( 3820): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err( 3820): 	... 1 more
I/[BDASR_LOG] MicrophoneServer( 3820): finally, mRemoteOutputStreams size = 0 firstStart = true
I/AsrManager( 3820): 停止录音


0
4
慕慕0466448
回复
不悔有你ii
好吧,谢谢老哥,我再试试
2019-08-14
共4条回复

CrazyCodeBoy

2019-04-10

百度语音SDK的配置错误,建议对照下百度提个的demo和课程这块的代码检查下:

https://git.imooc.com/coding-321/flutter_trip/src/master/android


0
0

Flutter从入门到进阶 实战携程网App 一网打尽核心技术

解锁Flutter开发新姿势,,系统掌握Flutter开发核心技术。

4788 学习 · 3270 问题

查看课程