Improve Audio Recording quality in android?

放肆的年华 提交于 2019-11-28 01:47:15

问题


I am using the MediaRecorder for audio recording in android. I receive very poor audio quality when I record. I checked iPhone recording, and it is very good, but in android I receive horrible sound.

For sound recording I use:

 recorder = new MediaRecorder();
 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
 recorder.setAudioEncoder(MediaRecorder.AudioSource.DEFAULT);
 recorder.setOutputFile(path);
 recorder.prepare();
 recorder.start(); 

How do I improve Audio Recording quality?


回答1:


Try this one -

recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setAudioEncoder(MediaRecorder.getAudioSourceMax());
recorder.setAudioEncodingBitRate(16);
recorder.setAudioSamplingRate(44100);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start(); 



回答2:


Android has mainly supported 3 sound formats (i mean from creation point of view) : 3gp, mp4 and amr. Actually all there quality is very poor, so nothing to do about that.

Anyway you can use external mp3 codecs or save it as wave file. Sounds will be more clear but such codec(wav) will require large voice file in comporations of three formats mentioned above.



来源:https://stackoverflow.com/questions/9389572/improve-audio-recording-quality-in-android

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