Mediarecorder.audiosource.voice_call not working in xiaomi redmi error

I tried to record the call using AudioSource.VOICE_CALL in Android. It works on most devices like (Samsung S3, Samsung S4, Nexus), but in redmi xiaomi 1s, it doesn't

Below is the piece of code I used:

MediaRecorder recorder = new MediaRecorder();
recorder.reset();
recorder.setAudioSource(audiosource);
recorder.setOutputFormat(audioformat);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);           
recorder.setOutputFile(recording.getAbsolutePath());
recorder.setOnInfoListener(this);
recorder.setOnErrorListener(this);

    try {
        recorder.prepare();
    } catch (java.io.IOException e) {
        recorder = null;
        return; 
    }

recorder.start();

      

+3


source to share





All Articles