使用MediaRecorder,为什么音频质量非常差记录在我的droidx? [英] very poor quality of audio recorded on my droidx using MediaRecorder, why?

查看:350
本文介绍了使用MediaRecorder,为什么音频质量非常差记录在我的droidx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目要求我能够在Android设备上录制音频。我实现了使用MediaRecorder()解决方案,但录制的音频是一个可怕的质量。我究竟做错了什么?我一定会认为这不能是录音:)也许我做错了什么,我包括我下面的code的唯一途径。请点我到正确的方向。

谢谢!

  MediaRecorder记录=新MediaRecorder();
文件OUTPUTFILE =新的文件(Environment.getExternalStorageDirectory(),audio.3gp);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);
recorder.setAudioEn codeR(MediaRecorder.AudioEn coder.AMR_NB);
recorder.setOutputFile(outputFile.getAbsolutePath());
。录音机prepare();
recorder.start();
// 停止
recorder.stop();
recorder.reset();
recorder.release();
 

解决方案

AMR_NB太臭。

将比特率16和采样速率为44100。

3GPP一般太臭,请尝试使用AAC / MPEG_4代替。

试试这个,更新我们。

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.

thanks!

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 stinks.

Set the bitrate to 16 and sampling rate to 44100.

3gpp generally stinks, try using AAC/MPEG_4 instead.

Try this and update us.

这篇关于使用MediaRecorder,为什么音频质量非常差记录在我的droidx?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆