我使用媒體記錄器錄製音頻文件 而我想減少輸出文件的大小或質量 如何以低質量降低輸出文件大小?媒體記錄器減少輸出文件大小
這是我的代碼
private MediaRecorder recorder = null;
int audioformat = Integer.parseInt(prefs.getString(Preferences.PREF_AUDIO_FORMAT, "1"));
switch (audioformat) {
case MediaRecorder.OutputFormat.THREE_GPP:
suffix = ".3gpp";
break;
case MediaRecorder.OutputFormat.MPEG_4:
suffix = ".mpg";
break;
case MediaRecorder.OutputFormat.RAW_AMR:
suffix = ".amr";
break;
}
recorder.setAudioSource(audiosource); recorder.setOutputFormat(audioformat); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
recorder.setOutputFile(recording.getAbsolutePath());
它與採樣率有關:http://stackoverflow.com/questions/16354269/sample-rate-in-android-audio-record-class-and-mediarecord-class –