문제

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);
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top