Thursday, 18 February 2021

MediaRecorder.Stop() fails on Samsung devices such as Galaxy A7, Galaxy A10s etc

    I am using the following settings to initialize MediaRecorder. My app is working fine on most devices except samsung and error occurs on MediaRecorder.stop().

    recorder = new MediaRecorder();
    recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    recorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
    recorder.setAudioEncodingBitRate(16*44100);
    recorder.setAudioSamplingRate(44100);

it throws the following error message.

java.lang.IllegalStateException: at android.media.MediaRecorder._stop (MediaRecorder.java) at android.media.MediaRecorder.stop (MediaRecorder.java:1440) at com.appname.stopRecording (add_new.java:4)

Could this be because i am using MIC as audio source for samsung devices instead of VOICE_CALL?



from MediaRecorder.Stop() fails on Samsung devices such as Galaxy A7, Galaxy A10s etc

No comments:

Post a Comment