Search code examples
javaandroidmediarecorderandroid-mediarecorder

Recording FLAC audio using AudioRecorder/MediaRecorder in Android


Is there any way by which we can record audio in FLAC or WAV format using AudioRecorder of MediaRecorder in Android Studio. If not, is there any other way?

According to this link, these types of file formats are supported on Android Studio but I can't seem to find the appropriate output format and audio encoder.

https://developer.android.com/guide/topics/media/media-formats.html


Solution

  • Android's MediaFormat and MediaCodec supports FLAC natively: Supported media formats

    This simple implementation does not even use JNI at all and does not implement additional dependencies:

    There is no advantage in FLAC format if recording in lossy like 3GP, AAC, OGG, or OPUS.