简体   繁体   中英

How to improve the audio quality on android

I am doing voice recording application on android using AudioRecorder Class and have worked with different Sample Rates 44100,32000,24000,16000 and 8000. The Sample Rate 44100 gives good quality audio but it takes very large size but other samples rate give bad and very bad quality audios with acceptable file sizes.

Before you say Possible of duplicate questions i have seen the following Links:

Link1

Link2

But the referred links are different from question.

my questions is how to get good quality audio with small file size for the sample rates such as 32000,24000 and 8000?

or Is there any way compress the wav file from large size to small one?.

my code sample:

tempbufferSize = AudioRecord.getMinBufferSize(16000,AudioFormat.CHANNEL_CONFIGURATION_MONO,AudioFormat.ENCODING_PCM_16BIT);
........
mAudioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,16000, AudioFormat.CHANNEL_CONFIGURATION_MONO,AudioFormat.ENCODING_PCM_16BIT,tempbufferSize);
mAudioRecord.startRecording();
.....

i have refered the Link.

please help me.

You do realize that when you increase the sample rate you get more samples per second and that effectively increases the size of the file. The approach is more quality, more data.

Some references for compression:


http://www.eetimes.com/design/analog-design/4017792/Audio-Compression-Algorithm-Overview

http://jspeex.sourceforge.net/index.php

http://flac.sourceforge.net/license.html <-- BSD license / lossless

http://jflac.sourceforge.net/ << Apache license / lossless

WAV is pure uncompressed audio data so without sacrificing quality, file sizes will be quite large. You could record to MPEG4 using MediaRecorder and setOutputFormat()

Look at:

MediaRecorder

OutputFormat MPEG4

Hope that helped

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM