使用 MediaRecorder 在我的 droidx 上录制的音频质量很差,为什么? [英] very poor quality of audio recorded on my droidx using MediaRecorder, why?
问题描述
我的项目要求我能够在 Android 设备上录制音频.我使用 MediaRecorder() 实现了解决方案,但录制的音频质量很差.我究竟做错了什么?我必须认为这不是录制音频的唯一方法:) 也许我做错了什么,我在下面包含了我的代码.请指出我正确的方向.
my project requires me to be able to record audio on an android device. i implemented solution using the MediaRecorder() but the recorded audio is in a terrible quality. what am i doing wrong? i must think that this cant be the only way to record audio :) perhaps i am doing something wrong, i am including my code below. please point me to the right direction.
谢谢!
MediaRecorder recorder = new MediaRecorder();
File outputFile = new File(Environment.getExternalStorageDirectory(), "audio.3gp");
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(outputFile.getAbsolutePath());
recorder.prepare();
recorder.start();
// stop
recorder.stop();
recorder.reset();
recorder.release();
推荐答案
AMR_NB 很糟糕.
AMR_NB stinks.
将比特率设置为 16,采样率设置为 44100.
Set the bitrate to 16 and sampling rate to 44100.
3gpp 通常很糟糕,请尝试改用 AAC/MPEG_4.
3gpp generally stinks, try using AAC/MPEG_4 instead.
试试这个并更新我们.
这篇关于使用 MediaRecorder 在我的 droidx 上录制的音频质量很差,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!