Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
498 views
in Technique[技术] by (71.8m points)

android - very poor quality of audio recorded on my droidx using MediaRecorder, why?

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();
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...