如何在Android 2.2中使用MediaRecorder录制M4A音频文件?
我需要设置什么输出格式、编码器和采样率?
我需要从麦克风录制并将其保存在SD卡中。
更新
我尝试了这段代码,但结果无效(例如不能在浏览器中播放):
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); // error here ?!?
recorder.setAudioSamplingRate(96000); // what value ?
ContentValues
,你只能使用put(MediaStore.Audio.Media.MIME_TYPE, "audio/aac")
,这样它将创建带有.aac
扩展名的文件,而不是.m4a
。 - undefined