简体   繁体   English

如何提高Android上的音频质量

[英]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. 我正在使用AudioRecorder类在android上进行语音录制应用程序,并且已经使用了不同的采样率44100、32000、24000、16000和8000。采样率44100可以提供高质量的音频,但是它占用的空间很大,但是其他采样率却很糟糕音频质量差且文件大小可接受。

Before you say Possible of duplicate questions i have seen the following Links: 在您说重复的问题的可能之前,我已经看到以下链接:

Link1 链接1

Link2 链接2

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? 我的问题是如何在32000、24000和8000等采样率下获得小文件大小的高质量音频?

or Is there any way compress the wav file from large size to small one?. 或有什么方法可以将wav文件从大文件压缩为小文件?

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://www.eetimes.com/design/analog-design/4017792/Audio-Compression-Algorithm-Overview

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

http://flac.sourceforge.net/license.html <-- BSD license / lossless http://flac.sourceforge.net/license.html <-BSD许可证/无损

http://jflac.sourceforge.net/ << Apache license / lossless http://jflac.sourceforge.net/ << Apache许可证/无损

WAV is pure uncompressed audio data so without sacrificing quality, file sizes will be quite large. WAV是纯未压缩的音频数据,因此在不牺牲质量的情况下,文件大小将非常大。 You could record to MPEG4 using MediaRecorder and setOutputFormat() 您可以使用MediaRecorder和setOutputFormat()录制到MPEG4

Look at: 看着:

MediaRecorder MediaRecorder

OutputFormat MPEG4 输出格式MPEG4

Hope that helped 希望能有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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