帖子

语音唤醒之后调用语音识别,出现错误码为启动录音失败.(...

[复制链接]

该用户从未签到

5891 158****8511 发表于 2019-11-19 19:07:39 1#
在Android 7.1.2版本上测试,语音唤醒之后调用语音识别,出现启动录音失败.(错误码:20006)的问题。而在Android 6版本则没有这个问题,各个代码都一样。分析原因,是在Android 7.1.2版本时,语音唤醒之后,焦点被占用,导致语音识别不了,但就算自己去申请多媒体焦点,哪怕焦点申请成功,还是出现录音失败.(错误码:20006)的问题,麻烦讯飞的技术人员帮忙回复下。
具体log如下:
11-18 12:30:30.407  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.408  4569  4569 D Companion_LogUtils: [ IFlytekAsrManager ] : mRecognizerListener onBeginOfSpeech: 开始说话
11-18 12:30:30.409  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.409  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.416  4569  8737 D MscSpeechLog:
11-18 12:30:30.416  4569  8737 D MscSpeechLog: SampleRate:16000
11-18 12:30:30.416  4569  8737 D MscSpeechLog: Channel:2
11-18 12:30:30.416  4569  8737 D MscSpeechLog: Format:2
11-18 12:30:30.416  4569  8737 D MscSpeechLog: FramePeriod:640
11-18 12:30:30.416  4569  8737 D MscSpeechLog: BufferSize:5120
11-18 12:30:30.416  4569  8737 D MscSpeechLog: MinBufferSize:1536
11-18 12:30:30.416  4569  8737 D MscSpeechLog: ActualBufferSize:1280
11-18 12:30:30.416   206   213 D GRALLOC-ROCKCHIP: enter, w : 184, h : 59, format : 0x1, usage : 0xb00.
11-18 12:30:30.418  4569  4635 D GRALLOC-ROCKCHIP: enter, w : 184, h : 59, format : 0x1, usage : 0xb00.
11-18 12:30:30.418   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.418  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.418  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.424   206   213 D GRALLOC-ROCKCHIP: enter, w : 184, h : 59, format : 0x1, usage : 0xb00.
11-18 12:30:30.425  4569  4635 D GRALLOC-ROCKCHIP: enter, w : 184, h : 59, format : 0x1, usage : 0xb00.
11-18 12:30:30.430  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.430  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.431  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.431  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.431  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.459   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.459  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.459  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.476  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.476  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.476  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.477  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.477  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.500   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.500  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.501  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.523  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.524  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.524  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.524  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.524  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.541   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.542  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.542  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.546  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.547  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.547  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.547  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.547  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.582  4569  4617 D MSC_LOG : JNI_IsrStatusCB
11-18 12:30:30.582  4569  4617 D MSC_LOG : JNI_IsrStatusCB AttachCurrentThread
11-18 12:30:30.583  4569  4617 D MSC_LOG : JNI_IsrStatusCB get sessionID chararray
11-18 12:30:30.584  4569  4617 D MSC_LOG : JNI_IsrStatusCB get param2 bytearray
11-18 12:30:30.584  4569  4617 D MSC_LOG : JNI_IsrStatusCB CallVoidMethod
11-18 12:30:30.584  4569  4617 D MSC_LOG : JNI_IsrStatusCB DetachCurrentThread
11-18 12:30:30.588   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.593  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.593  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.594  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.595  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.595  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.595  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.596  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.636   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.636  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.636  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.639  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.639  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.639  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.640  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.640  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.662  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.662  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.662  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.663  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.663  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.677   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.678  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.678  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.709  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.709  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.709  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.709  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.709  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.719   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.719  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.719  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.755  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.756  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.756  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.756  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.756  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.761   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.761  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.761  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.779  4569  8675 D MscSpeechLog: onVolumeChanged
11-18 12:30:30.779  4569  8675 E djsun   : MSG_RECORD_AUDIO
11-18 12:30:30.779  4569  8675 E MscSpeechLog: readRecordData:count=1280
11-18 12:30:30.779  4569  8674 E MscSpeechLog: djsun,uploadData
11-18 12:30:30.779  4569  8674 E MscSpeechLog: djsun,MSC.QIVWAudioWrite
11-18 12:30:30.802   249  4386 E APM_AudioPolicyManager: startInput(142) failed: other input 134 already started
11-18 12:30:30.803  4569  8737 E AudioRecord: start() status -38
11-18 12:30:30.803  4569  8737 E MscSpeechLog: recorder state is not recoding
11-18 12:30:30.803  4569  8737 E MscSpeechLog: recoder start failed
11-18 12:30:30.804  4569  8737 W System.err: 启动录音失败.(错误码:20006)
11-18 12:30:30.804  4569  8737 W System.err:    at com.iflytek.cloud.record.PcmRecorder.run(SourceFile:268)
11-18 12:30:30.804  4569  8737 D MscSpeechLog: clear all message
11-18 12:30:30.805  4569  8737 D MscSpeechLog: curStatus=recording,setStatus=exiting
11-18 12:30:30.805  4569  8737 D MscSpeechLog: setStatus success=exiting
11-18 12:30:30.805  4569  8737 D MscSpeechLog: release record begin
11-18 12:30:30.805  4569  8736 D MscSpeechLog: onSessionEnd
11-18 12:30:30.806  4569  8736 D MscSpeechLog: stop record
11-18 12:30:30.807  4569  8737 D MscSpeechLog: release record over


小七 发表于 2019-11-21 10:37:03
2#
Android SDK近期已更新,可下载最新SDK测试下
使用道具 举报 回复