Brief information. How to check if voice recording is running in the background in another application.
More: if voice recording is already running in the background from your own application: voice recorder. Now I have applied voice recording as one of the functions in my application.
Problem: while trying to write in my application, an error occurs at the same time:
: E/MediaRecorder: start failed: -38 : E/MyApp: [1162][com.sec.MyApp.multimedia.RecordMyVoice]java.lang.IllegalStateException : E/MyApp: at android.media.MediaRecorder.start(Native Method) : E/MyApp: at com.sec.MyApp.multimedia.RecordMyVoice.doInBackground(RecordMyVoice.java:100)
Code on the 100th line in RecordMyVoice.java:
mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setOutputFile(mFileName); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mRecorder.prepare(); mRecorder.start();
But the problem is that voice recording is already in progress in the background. Therefore, is there a way to stop voice recording if it works in another application.
Any input would be very helpful.
parul source share