So far I have this: With this code I can configure Media Recorder to record in 3gp, but i need to record in WAV for a later process.
private void setupMediaRecorder() {
mediaRecorder = new MediaRecorder();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mediaRecorder.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
mediaRecorder.setOutputFile(MainActivity.PATH_TEMP_RECORDING);
}
Found it. This configuration works:
mediaRecorder = new MediaRecorder();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediaRecorder.setOutputFormat(AudioFormat.ENCODING_PCM_16BIT);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
mediaRecorder.setAudioChannels(1);
mediaRecorder.setAudioEncodingBitRate(128000);
mediaRecorder.setAudioSamplingRate(48000);
mediaRecorder.setOutputFile(MainActivity.PATH_TEMP_RECORDING);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With