我在使用设备麦克风时遇到一些问题,当我开始使用记录音频的mediarecorder时,我尝试启动语音识别器的识别器意图,我得到 IllegalStateException启动失败:-38
logcat的
AudioRecord:start()status -38
10-10 11:25:11.180 23074-23074 / com.example.techno_110.recordaudio D / ViewRootImpl:ViewPostImeInputStage ACTION_DOWN 10-10 11:25:11.280 23074-23074 / com.example.techno_110.recordaudio E / MainActivity: setUpMediaRecorder:=>> /storage/emulated/0/audiofile.3gpp 10-10 11:25:11.320 23074-23074 / com.example.techno_110.recordaudio E / MainActivity:开始:==>音频录制开始10-10 11:25:11.380 23074-23074 / com.example.techno_110.recordaudio E / MediaRecorder:开始 失败:-38 10-10 11:25:11.380 23074-23074 / com.example.techno_110.recordaudio W / System.err: java.lang.IllegalStateException 10-10 11:25:11.380 23074-23074 / com.example.techno_110.recordaudio W / System.err:at android.media.MediaRecorder.start(Native Method)10-10 11:25:11.380 23074-23074 / com.example.techno_110.recordaudio W / System.err:at com.example.techno_110.recordaudio.MainActivity.start(MainActivity.java:313) 10-10 11:25:11.380 23074-23074 / com.example.techno_110.recordaudio W / System.err:at com.example.techno_110.recordaudio.MainActivity $ 1.onClick(MainActivity.java:115) 10-10 11:25:11.380 23074-23074 / com.example.techno_110.recordaudio W / System.err:在android.view.View.performClick(View.java:5214) 10-10 11:25:11.380 23074-23074 / com.example.techno_110.recordaudio W / System.err:at android.view.View $ PerformClick.run(View.java:20978)10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at android.os.Handler.handleCallback(Handler.java:739)10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at android.os.Handler.dispatchMessage(Handler.java:95)10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at android.os.Looper.loop(Looper.java:145)10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at android.app.ActivityThread.main(ActivityThread.java:6134)10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at java.lang.reflect.Method.invoke(Native Method) 10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at java.lang.reflect.Method.invoke(Method.java:372) 10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1399) 10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio W / System.err:at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)10-10 11:25:11.390 23074-23074 / com.example.techno_110.recordaudio E / MainActivity:识别:==>开始收听交易10-10 11:25:11.400 23074-23074 / com.example.techno_110.recordaudio D / NMT: RecorderSource $ 1:开始录制10-10 11:25:11.410 23074-23864 / com.example.techno_110.recordaudio D / NMT: AttachableHandler:附加到当前线程的处理程序,发送1 排队的消息10-10 11:25:11.420 23074-23074 / com.example.techno_110.recordaudio D / NMT: CommandContextImpl:创建命令NMDP_ASR_CMD 10-10 11:25:11.420 23074-23117 / com.example.techno_110.recordaudio D / NMSP_:[ResourceImpl] loadResource 10-10 11:25:11.430 23074-23117 / com.example.techno_110.recordaudio D / NMSP_:[NMSPSession] 创建新的SDK calllog tree 10-10 11:25:11.430 23074-23864 / com.example.techno_110.recordaudio E / AudioRecord:start() 状态-38 10-10 11:25:11.430 23074-23864 / com.example.techno_110.recordaudio V / NMT: MicrophoneRecorderSourceBase $ 2:Android音频系统onMarkerReached 10-10 11:25:11.430 23074-23864 / com.example.techno_110.recordaudio E / NMT: MicrophoneRecorderSource:readBuffer()_ record.read()没有读过 任何音频!!! 10-10 11:25:11.430 23074-23864 / com.example.techno_110.recordaudio D / NMT: MicrophoneRecorderSource:cleanup()stop _recorder。 10-10 11:25:11.430 23074-23864 / com.example.techno_110.recordaudio D / NMT: MicrophoneRecorderSource:cleanup()release _recorder。 10-10 11:25:11.440 23074-23864 / com.example.techno_110.recordaudio D / NMT: MicrophoneRecorderSource:handleSourceClosed()10-10 11:25:11.440 23074-23117 / com.example.techno_110.recordaudio I / NMSP: [PDXTransactionImpl] appendLogToQueryBegin: 禁用NMSPDefines.DEVICE_CMD_LOG_TO_SERVER_ENABLED 10-10 11:25:11.450 23074-23074 / com.example.techno_110.recordaudio D / NMT: CommandContextImpl:发送参数REQUEST_INFO 10-10 11:25:11.450 23074-23074 / com.example.techno_110.recordaudio D / NMT: CommandContextImpl:发送参数AUDIO_INFO 10-10 11:25:11.450 23074-23074 / com.example.techno_110.recordaudio D / NMT: CommandContextImpl:结束命令10-10 11:25:11.450 23074-23074 / com.example.techno_110.recordaudio D / NMT:AudioParam: stream()10-10 11:25:11.460 23074-23074 / com.example.techno_110.recordaudio D / NMT:AudioParam: sourceClosed()10-10 11:25:11.460 23074-23074 / com.example.techno_110.recordaudio D / NMT: CommandContextImpl:[LATCHK]调用addAudioBuf()最后10-10 11:25:11.460 23074-23074 / com.example.techno_110.recordaudio D / NMT: CommandContextImpl:stream audio last buffer [true] 10-10 11:25:57.070 23074-23869 / com.example.techno_110.recordaudio E / NMSP: [NetworkSystemOEM]设置套接字选项异常 - [javax.net.ssl.SSLHandshakeException]消息 - [SSL握手 aborted:ssl = 0xaf541e00:系统调用期间的I / O错误,连接 由同行重置] 10-10 11:25:57.080 23074-23117 / com.example.techno_110.recordaudio E / NMSP:[XMode] XMode.openSocketCallback()NETWORK_ERROR 10-10 11:25:57.080 23074-23117 / com.example.techno_110.recordaudio D / NMSP_: [NMASResourceImpl] onSessionDisconnected()reasonCode:9 10-10 11:25:57.080 23074-23117 / com.example.techno_110.recordaudio E / NMT: CommandContextImpl:命令创建失败[NMDP_ASR_CMD] 10-10 11:25:57.080 23074-23074 / com.example.techno_110.recordaudio D / NMT: TransactionStateStreaming:Streaming参数:AUDIO_INFO是 取消。 10-10 11:25:57.080 23074-23074 / com.example.techno_110.recordaudio D / NMT:AudioParam: cancelStreaming()10-10 11:25:57.080 23074-23117 / com.example.techno_110.recordaudio W / NMT: CloudServicesImpl:连接失败reasonCode [10]
我经常搜索以解决这个问题,请有人帮我解决这个问题。