0

i have some problem when using device mic simuntaniously , When i have started mediarecorder for record audio and i am try to start recognizer intent for speech recognizer i am getting IllegalStateException start failed: -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: start: ==> Started Audio Recording 10-10 11:25:11.380 23074-23074/com.example.techno_110.recordaudio E/MediaRecorder: start failed: -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: at 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: recognize: ==> Started listening transactions 10-10 11:25:11.400 23074-23074/com.example.techno_110.recordaudio D/NMT: RecorderSource$1: Starting recording 10-10 11:25:11.410 23074-23864/com.example.techno_110.recordaudio D/NMT: AttachableHandler: Attached handler to current thread, sending 1 queued messages 10-10 11:25:11.420 23074-23074/com.example.techno_110.recordaudio D/NMT: CommandContextImpl: Creating command 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] Creating new SDK calllog tree 10-10 11:25:11.430 23074-23864/com.example.techno_110.recordaudio E/AudioRecord: start() status -38 10-10 11:25:11.430 23074-23864/com.example.techno_110.recordaudio V/NMT: MicrophoneRecorderSourceBase$2: Android audio system onMarkerReached invoked 10-10 11:25:11.430 23074-23864/com.example.techno_110.recordaudio E/NMT: MicrophoneRecorderSource: readBuffer() _recorder.read() didn't read any audio!!! 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 is disabled 10-10 11:25:11.450 23074-23074/com.example.techno_110.recordaudio D/NMT: CommandContextImpl: Sending param REQUEST_INFO 10-10 11:25:11.450 23074-23074/com.example.techno_110.recordaudio D/NMT: CommandContextImpl: Sending param AUDIO_INFO 10-10 11:25:11.450 23074-23074/com.example.techno_110.recordaudio D/NMT: CommandContextImpl: Ending command 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] calling addAudioBuf() final 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] Set Socket Option Exception - [javax.net.ssl.SSLHandshakeException] Message - [SSL handshake aborted: ssl=0xaf541e00: I/O error during system call, Connection reset by peer] 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: Command Creation Failed [NMDP_ASR_CMD] 10-10 11:25:57.080 23074-23074/com.example.techno_110.recordaudio D/NMT: TransactionStateStreaming: Streaming parameter: AUDIO_INFO is cancelled. 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: Connection failed reasonCode [10]

I had searched a lot to overcome this problem , please someone help me out to fix this issue.

mehrdad khosravi
  • 2,228
  • 9
  • 29
  • 34
Rajesh Koshti
  • 572
  • 1
  • 7
  • 25
  • 1
    Possible duplicate of [Android record audio while doing speech recognition](http://stackoverflow.com/questions/39765018/android-record-audio-while-doing-speech-recognition) – brandall Oct 10 '16 at 13:57
  • http://stackoverflow.com/questions/23047433/record-save-audio-from-voice-recognition-intent – Robert Rowntree Oct 21 '16 at 17:04
  • 1
    Google speech recognizer will give me audio file also but Quality of a audio file is very poor so i want to use third party library for speech recognisation i am familier with nuance speech recognisation , but getting same error with nuance , help me out to fix this issue – Rajesh Koshti Oct 22 '16 at 05:43
  • 1
    it seems to be not possible – Sagar Mar 15 '18 at 12:42
  • yes it needs two mics in device to perform both operation on same time – Rajesh Koshti Mar 15 '18 at 12:53

0 Answers0