Question

I am trying to record an audio from my android app. Everything worked well. Recently, I had to change the output format from MPEG4 to AAC_ADTS. The issue is that AAC_ADTS does not work for one of the device It works on the other device. So, my question is does AAC_ADTS format work only on certain android versions. How can I get the audio recorded in AAC_ADTS format from all devices? Kindly help

mRecorder = new MediaRecorder();
        mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        mRecorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS);
//        mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
//        mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
        mRecorder.setOutputFile(mFileName);

        mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
Was it helpful?

Solution

AAC_ADTS format is added in API level 16, and works only on android versions 4.1+. See this link below. http://developer.android.com/reference/android/media/MediaRecorder.OutputFormat.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top