简体   繁体   English

提高 Android 录音质量?

[英]Improve Android Audio Recording quality?

Is there any way to record audio in high quality?有什么方法可以录制高质量的音频吗?

And how can I read information that user is saying something?我如何阅读用户正在说的信息? In Audio Recording application you can see such indicator (I don't know the right name for it).在录音应用程序中,您可以看到这样的指示器(我不知道它的正确名称)。

At the moment, a big reason for poor audio quality recording on Android is the codec used by the MediaRecorder class (the AMR-NB codec). 目前,在Android上录制音质不佳的一个重要原因是MediaRecorder类(AMR-NB编解码器)使用的编解码器。 However, you can get access to uncompressed audio via the AudioRecord class, and record that into a file directly. 但是,您可以通过AudioRecord类访问未压缩的音频,并将其直接记录到文件中。

The Rehearsal Assistant app does this to save uncompressed audio into a WAV file - take a look at the RehearsalAudioRecord class source code. Rehearsal Assistant应用程序执行此操作以将未压缩的音频保存到WAV文件中 - 查看RehearsalAudioRecord类源代码。

The RehearsalAudioRecord class also provides a getMaxAmplitude method, which you can use to detect the maximum audio level since the last time you called the method (MediaRecorder also provides this method). RehearsalAudioRecord类还提供了一个getMaxAmplitude方法,您可以使用该方法检测自上次调用方法以来的最大音频级别(MediaRecorder也提供此方法)。

For recording and monitoring: You can use the sound recorder activity. 用于录制和监控:您可以使用录音机活动。 Here's a snippet of code: 这是一段代码:

Intent recordIntent = new Intent(
                MediaStore.Audio.Media.RECORD_SOUND_ACTION);
            startActivityForResult(recordIntent, REQUEST_CODE_RECORD);

For a perfect working example of how to record audio which includes an input monitor, download the open source Ringdroid project: https://github.com/google/ringdroid 有关如何录制包含输入监视器的音频的完美工作示例,请下载开源Ringdroid项目: https//github.com/google/ringdroid

Look at the screenshots and you'll see the monitor. 看截图,你会看到显示器。

For making the audio higher quality, you'd need a better mic. 为了使音质更高,您需要更好的麦克风。 The built in mic can only capture so much (which is not that good). 内置麦克风只能捕获这么多(这不是那么好)。 Again, look at the ringdroid project, glean some info from there. 再看看ringdroid项目,从那里收集一些信息。 At that point you could implement some normalization and amplification routines to improve the sound. 此时,您可以实现一些归一化和放大程序来改善声音。

I give you a simple answer.我给你一个简单的答案。

  1. for samplerate, about the quality, 48000 is almost the same as 16000.对于采样率,关于质量,48000 与 16000 几乎相同。
  2. for bitrate, about the quality, 96Kbps is much better than 16Kbps.对于比特率,关于质量,96Kbps 比 16Kbps 好很多。
  3. you can try stereo(channelCount = 2), but make little change.您可以尝试立体声(channelCount = 2),但不要做太多改变。

So, for android phones, just set the audio bit rate bigger, you will get the better quality.所以,对于android手机,只要把音频码率设置大一点,音质就会好一些。

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

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