Android audio recording issue with MediaRecorder OutputFormat AAC_ADTS

穿精又带淫゛_ 提交于 2019-12-24 19:28:58

问题


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);

回答1:


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



来源:https://stackoverflow.com/questions/20146510/android-audio-recording-issue-with-mediarecorder-outputformat-aac-adts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!