使用 Android SDK的DEMO,一直显示"录音中"
天****驶 · 天****驶 发布于2017-07-11 14:33 浏览:1762 回复:9

下载Android SDK DEMO,编译成功运行,点击"点击说话"按钮后,无论说什么都显示"录音中",过一阵子就Toast提示"识别失败",手机为红米 3S


07-11 14:32:50.215 25823-25823/com.baidu.duer.dcs I/Timeline: Timeline: Activity_launch_request time:17973450

07-11 14:32:50.235 25823-25823/com.baidu.duer.dcs I/ViewRootImpl: CPU Rendering VSync enable = true

07-11 14:32:50.325 25823-25909/com.baidu.duer.dcs D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290

07-11 14:32:50.325 25823-25823/com.baidu.duer.dcs D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor

07-11 14:32:50.325 25823-25823/com.baidu.duer.dcs W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring

07-11 14:32:50.335 25823-25823/com.baidu.duer.dcs D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false

07-11 14:32:50.335 25823-25823/com.baidu.duer.dcs D/EgretLoader: EgretLoader(Context context)

07-11 14:32:50.335 25823-25823/com.baidu.duer.dcs D/EgretLoader: The context is not activity

07-11 14:32:50.345 25823-25823/com.baidu.duer.dcs I/cr_Ime: ImeThread is not enabled.

07-11 14:32:50.365 25823-25823/com.baidu.duer.dcs D/DCS-OkHttpRequestImpl: doGetDirectivesAsync

07-11 14:32:50.365 25823-25823/com.baidu.duer.dcs E/MediaPlayer-JNI: QCMediaPlayer mediaplayer NOT present

07-11 14:32:50.365 25823-25922/com.baidu.duer.dcs D/DCS-HttpLog: request: GET [https://dueros-h2.baidu.com/dcs/v1/directives] null

                                                                 Content-Type: multipart/form-data boundary=dumi-boundory

                                                                 dueros-device-id: ffffffff-e76f-1bc0-0000-00001aff3d52

                                                                 debug: 0

                                                                 Authorization: Bearer 23.c9b015417b17dfa5836d56b14b760786.2592000.1502339287.3332611192-9872095

07-11 14:32:50.375 25823-25823/com.baidu.duer.dcs E/MediaPlayer-JNI: QCMediaPlayer mediaplayer NOT present

07-11 14:32:50.375 25823-25823/com.baidu.duer.dcs E/MediaPlayer-JNI: QCMediaPlayer mediaplayer NOT present

07-11 14:32:50.385 25823-25823/com.baidu.duer.dcs I/ViewRootImpl: CPU Rendering VSync enable = true

07-11 14:32:50.395 25823-25823/com.baidu.duer.dcs D/ActivityThreadInjector: clearCachedDrawables.

07-11 14:32:50.425 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: onError,

                                                                   okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL

                                                                       at okhttp3.internal.http2.Http2Stream.takeResponseHeaders(Http2Stream.java:153)

                                                                       at okhttp3.internal.http2.Http2Codec.readResponseHeaders(Http2Codec.java:120)

                                                                       at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                                                                       at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                                                                       at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                                                                       at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                                                                       at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                                                                       at com.baidu.duer.dcs.http.intercepter.LoggingInterceptor.intercept(LoggingInterceptor.java:42)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)

                                                                       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)

                                                                       at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)

                                                                       at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)

                                                                       at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)

                                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)

                                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

                                                                       at java.lang.Thread.run(Thread.java:818)

07-11 14:32:50.435 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: getDirectives onFailed

07-11 14:32:50.435 25823-25823/com.baidu.duer.dcs D/DCS-DcsFramework: onUnconnected

07-11 14:32:50.435 25823-25823/com.baidu.duer.dcs W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 25823

07-11 14:32:50.435 25823-25823/com.baidu.duer.dcs D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false

07-11 14:32:50.465 25823-25823/com.baidu.duer.dcs D/DCS-OkHttpRequestImpl: doPostEventStringAsync-bodyJson:{"event":{"header":{"name":"LinkClicked","namespace":"ai.dueros.device_interface.screen","messageId":"7bc34f9a-3c6e-455e-8f59-48b434c35bb2"},"payload":{"url":"about:blank"}}}

07-11 14:32:50.465 25823-27624/com.baidu.duer.dcs D/DCS-HttpLog: request: POST [https://dueros-h2.baidu.com/dcs/v1/events] null

                                                                 Content-Type: multipart/form-data boundary=dumi-boundory

                                                                 dueros-device-id: ffffffff-e76f-1bc0-0000-00001aff3d52

                                                                 debug: 0

                                                                 Authorization: Bearer 23.c9b015417b17dfa5836d56b14b760786.2592000.1502339287.3332611192-9872095

07-11 14:32:50.515 25823-25823/com.baidu.duer.dcs I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@16db22fb time:17973755

07-11 14:32:51.045 25823-25922/com.baidu.duer.dcs D/DCS-HttpLog: response: 200 [https://dueros-h2.baidu.com/dcs/v1/directives] 671.7ms

                                                                 content-type: multipart/related; boundary=___dumi_avs_xuejuntao___; type=application/json

                                                                 date: Tue, 11 Jul 2017 06:32:50 GMT

                                                                 remote-server: 10.123.216.42:8230

                                                                 x-powered-by: Express

07-11 14:32:51.045 25823-27624/com.baidu.duer.dcs D/DCS-HttpLog: response: 204 [https://dueros-h2.baidu.com/dcs/v1/events] 574.3ms

                                                                 content-type: multipart/form-data; boundary=___dumi_avs_xuejuntao___

                                                                 date: Tue, 11 Jul 2017 06:32:50 GMT

                                                                 x-powered-by: Express

07-11 14:32:51.045 25823-25823/com.baidu.duer.dcs D/DCS-ResponseCallback: onResponse:200

07-11 14:32:51.045 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: onResponse OK ,https://dueros-h2.baidu.com/dcs/v1/directives

07-11 14:32:51.045 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: onResponse code ,200

07-11 14:32:51.045 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: getDirectives onSucceed

07-11 14:32:51.055 25823-25823/com.baidu.duer.dcs D/DCS-DcsFramework: onConnected

07-11 14:32:51.055 25823-25823/com.baidu.duer.dcs D/DCS-OkHttpRequestImpl: doPostEventStringAsync-bodyJson:{"clientContext":[{"header":{"name":"PlaybackState","namespace":"ai.dueros.device_interface.audio_player"},"payload":{"offsetInMilliseconds":0,"playerActivity":"FINISHED","token":""}},{"header":{"name":"AlertsState","namespace":"ai.dueros.device_interface.alerts"},"payload":{"activeAlerts":[],"allAlerts":[]}},{"header":{"name":"VolumeState","namespace":"ai.dueros.device_interface.speaker_controller"},"payload":{"muted":false,"volume":80}},{"header":{"name":"SpeechState","namespace":"ai.dueros.device_interface.voice_output"},"payload":{"offsetInMilliseconds":0,"playerActivity":"FINISHED","token":""}}],"event":{"header":{"name":"SynchronizeState","namespace":"ai.dueros.device_interface.system","messageId":"ccf5f338-6619-4e9e-b842-46ef8e157c41"},"payload":{}}}

07-11 14:32:51.055 25823-25823/com.baidu.duer.dcs D/DCS-ResponseCallback: onResponse:204

07-11 14:32:51.055 25823-27624/com.baidu.duer.dcs D/DCS-HttpLog: request: POST [https://dueros-h2.baidu.com/dcs/v1/events] null

                                                                 Content-Type: multipart/form-data boundary=dumi-boundory

                                                                 dueros-device-id: ffffffff-e76f-1bc0-0000-00001aff3d52

                                                                 debug: 0

                                                                 Authorization: Bearer 23.c9b015417b17dfa5836d56b14b760786.2592000.1502339287.3332611192-9872095

07-11 14:32:51.065 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: onResponse OK ,https://dueros-h2.baidu.com/dcs/v1/events

07-11 14:32:51.065 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: onResponse code ,204

07-11 14:32:51.555 25823-27624/com.baidu.duer.dcs D/DCS-HttpLog: response: 204 [https://dueros-h2.baidu.com/dcs/v1/events] 492.1ms

                                                                 content-type: multipart/form-data; boundary=___dumi_avs_xuejuntao___

                                                                 date: Tue, 11 Jul 2017 06:32:51 GMT

                                                                 x-powered-by: Express

07-11 14:32:51.555 25823-25823/com.baidu.duer.dcs D/DCS-ResponseCallback: onResponse:204

07-11 14:32:51.555 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: onResponse OK ,https://dueros-h2.baidu.com/dcs/v1/events

07-11 14:32:51.555 25823-25823/com.baidu.duer.dcs D/DCS-DcsClient: onResponse code ,204

07-11 14:33:02.085 25823-25823/com.baidu.duer.dcs D/DCS-BaseMultiChannelMediaPlayer: ChannelMediaPlayer-setActive-isActive:true

07-11 14:33:02.085 25823-25823/com.baidu.duer.dcs D/DCS-BaseMultiChannelMediaPlayer: ChannelMediaPlayer-stop-channelName:dialog

07-11 14:33:02.095 25823-25823/com.baidu.duer.dcs E/MediaPlayer: stop called in state 1

07-11 14:33:02.095 25823-25823/com.baidu.duer.dcs E/MediaPlayer: error (-38, 0)

07-11 14:33:02.095 25823-25823/com.baidu.duer.dcs D/DCS-BaseMultiChannelMediaPlayer: ListenerProxy onStopped  del:dialog

07-11 14:33:02.095 25823-25823/com.baidu.duer.dcs D/DCS-BaseMultiChannelMediaPlayer: ListenerProxy onStopped after del :0

07-11 14:33:02.095 25823-25823/com.baidu.duer.dcs D/DCS-OkHttpRequestImpl: doPostEventMultipartAsync-bodyJson:{"clientContext":[{"header":{"name":"PlaybackState","namespace":"ai.dueros.device_interface.audio_player"},"payload":{"offsetInMilliseconds":0,"playerActivity":"FINISHED","token":""}},{"header":{"name":"AlertsState","namespace":"ai.dueros.device_interface.alerts"},"payload":{"activeAlerts":[],"allAlerts":[]}},{"header":{"name":"VolumeState","namespace":"ai.dueros.device_interface.speaker_controller"},"payload":{"muted":false,"volume":80}},{"header":{"name":"SpeechState","namespace":"ai.dueros.device_interface.voice_output"},"payload":{"offsetInMilliseconds":1,"playerActivity":"FINISHED","token":""}}],"event":{"header":{"name":"ListenStarted","namespace":"ai.dueros.device_interface.voice_input","messageId":"ea36d3ed-6f7e-42b4-87be-f5541db6232a","dialogRequestId":"e14d0691-3c5c-4c46-85c9-3a25cd1d152b"},"payload":{"format":"AUDIO_L16_RATE_16000_CHANNELS_1"}}}

07-11 14:33:02.105 25823-27624/com.baidu.duer.dcs D/DCS-HttpLog: request: POST [https://dueros-h2.baidu.com/dcs/v1/events] null

                                                                 Content-Type: multipart/form-data boundary=dumi-boundory

                                                                 dueros-device-id: ffffffff-e76f-1bc0-0000-00001aff3d52

                                                                 debug: 0

                                                                 Authorization: Bearer 23.c9b015417b17dfa5836d56b14b760786.2592000.1502339287.3332611192-9872095

07-11 14:33:02.105 25823-25823/com.baidu.duer.dcs D/DCS-DcsDemoActivity: onStartRecord

07-11 14:33:02.115 25823-25823/com.baidu.duer.dcs E/MediaPlayer: Error (-38,0)

07-11 14:33:02.115 25823-25823/com.baidu.duer.dcs D/DCS-MediaPlayerImpl: onError:-38, extra:0


点赞  ( 0 )
收藏
评论(9)
共9条回复 最后由c****a回复于2018-02-27 18:06
#2天****驶回复于2017-07-11 15:43:44

搞定了,是我代码修改错了

0
#3D****童回复于2017-07-11 17:35:58
#2 天****驶回复
搞定了,是我代码修改错了

您好,感谢您对DuerOS的关注与支持~

DuerOS接入所需的相关协议,都可在资源中心中进行查看\下载;

资源中心:http://developer.dueros.baidu.com/doc/overall/open-platform-intro_markdown


除此之外,我们在DuerOS技术课堂中,提供了详细的视频教程,方便开发者快速入门。

DuerOS技术课堂:http://developer.dueros.baidu.com/openduer/news/technicalclass


祝您生活愉快~

 

请持续关注DuerOS官方论坛,了解最新资讯:

http://developer.dueros.baidu.com/openduer/news/developerforum


DuerOS开发者交流QQ群: 604592023


1
#4c****i回复于2017-08-09 17:37:20

同样的问题,请问怎么改的,我是加了个拦截器,然后就报了这个了

0
#5H****7回复于2017-08-10 11:33:48

先把拦截器去掉试试吧


0
#6c****i回复于2017-08-15 17:54:14
#5 H****7回复
先把拦截器去掉试试吧

现在拦截器都去掉了,还是报这个错误。程序一启动,是正常的,2次或者3次后,就报这个错误了,后面就一直是这个错误,我是跑在things系统上的,webView显示部分被我去掉了

0
#7H****7回复于2017-08-17 21:18:04

去github pull最新版本即可!

0
#81****2回复于2017-08-19 17:07:20

请问楼主,安卓应用接入此sdk可以参考哪里呀!有帮助文档么?

0
#9c****a回复于2018-02-27 18:05:36
#2 天****驶回复
搞定了,是我代码修改错了

请问 楼主是怎么解决的

0
#10c****a回复于2018-02-27 18:06:12
#7 H****7回复
去github pull最新版本即可!

我 pull 的都是 最新的 , 还是有这个问题

0
TOP