1

I am trying to create an audio recorder app that records audio and should save audio only when users click on the save button. But the problem I am facing is that as soon as recording stops it saves automatically. And if I try to set setOutputFile to null then the app crashes.

Code

    mediaRecorder = new MediaRecorder();
    mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
    mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    mediaRecorder.setOutputFile(AudioSavePathInDevice);

Does Anybody know how to save that audio recording manually?

HARSH ASHRA
  • 176
  • 1
  • 4
  • 20
  • You can try AudioRecord ,more detail in this link https://stackoverflow.com/a/34735609/5553085 – Better Mar 01 '22 at 09:44

0 Answers0