Android Mediarecorder setNextOutputFile IllegalStateException
Android Mediarecorder setNextOutputFile IllegalStateException I am trying to split my audio recording with android mediarecorder into multiple files, but whenever I set the next output file, I got an illegalstate exception. Here's the code: private void getMediaRecorderReady(String filePath, FileDescriptor nextFile) { bufferSize = 88200; recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); recorder.setAudioEncodingBitRate(64000); recorder.setAudioSamplingRate(44100); recorder.setAudioChannels(1); recorder.setOutputFile(filePath); recorder.setMaxDuration(1000); recorder.setMaxFileSize(100000); try { recorder.prepare(); recorder.setNextOutputFile(nextFile); } catch (IOException e) { e.printStackTrace(); } } And here's the error: E/MediaRecorder...