i\'ve searched many topics but no straight answer.
I have this code :
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecord
Try putting the start function in the same block as prepare function. maybe there's an exception blocking prepare from executing and goes directly to start thus causing an IllegalStateException.
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(output_formats[currentFormat]);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(getFilename());
try {
recorder.prepare();
recorder.start();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}