Skip to content Skip to sidebar Skip to footer

Error On Mediarecorder Stop : Stop Called In Invalid State 4

I'm creating a recording voice app, when I'm trying to stop recording the Debug Console in java says that: 'MediaRecorder stop called in an invalid state : 4' Here is part of my

Solution 1:

private void stopRecording() {
    if (null != recorder){
        try {
            recorder.prepare();  <-- Here's the problem

You should not be calling prepare when you're stopping the MediaRecorder. The prepare method is something you call prior to starting the recorder. Refer to the state diagram in the MediaRecorder documentation.


Post a Comment for "Error On Mediarecorder Stop : Stop Called In Invalid State 4"