提高 Android 录音质量?

发布于 2024-08-05 13:53:03 字数 79 浏览 4 评论 0原文

有什么方法可以录制高质量的音频吗?

我如何读取用户所说的信息?在录音应用程序中,您可以看到这样的指示器(我不知道它的正确名称)。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沫离伤花 2024-08-12 13:53:03

目前,Android 上录制音频质量不佳的一个重要原因是 MediaRecorder 类使用的编解码器(AMR-NB 编解码器)。但是,您可以通过 AudioRecord 类访问未压缩的音频,并将其直接录制到文件中。

排练助手应用执行此操作,将未压缩的音频保存到 WAV 文件中 - 请查看RehearsalAudioRecord 类源代码。

RehearsalAudioRecord 类还提供了 getMaxAmplitude 方法,您可以使用该方法来检测自上次调用该方法以来的最大音频级别(MediaRecorder 也提供此方法)。

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). However, you can get access to uncompressed audio via the AudioRecord class, and record that into a file directly.

The Rehearsal Assistant app does this to save uncompressed audio into a WAV file - take a look at the RehearsalAudioRecord class source code.

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

长梦不多时 2024-08-12 13:53:03

对于录音和监控:您可以使用录音机活动。
以下是一段代码:

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

有关如何录制包括输入监视器的音频的完美工作示例,请下载开源 Ringdroid 项目:https://github.com/google/ringdroid

查看屏幕截图,您会看到监视器。

为了使音频质量更高,您需要更好的麦克风。内置麦克风只能捕获这么多(这不太好)。再次查看ringdroid 项目,从那里收集一些信息。此时,您可以实施一些标准化和放大例程来改善声音。

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

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. At that point you could implement some normalization and amplification routines to improve the sound.

惯饮孤独 2024-08-12 13:53:03

我给你一个简单的答案。

  1. 对于采样率,关于质量,48000与16000几乎相同。
  2. 对于比特率,关于质量,96Kbps比16Kbps好得多。
  3. 您可以尝试立体声(channelCount = 2),但只需进行少量更改。

所以,对于安卓手机,只需将音频比特率设置得更大,你就会得到更好的质量。

I give you a simple answer.

  1. for samplerate, about the quality, 48000 is almost the same as 16000.
  2. for bitrate, about the quality, 96Kbps is much better than 16Kbps.
  3. you can try stereo(channelCount = 2), but make little change.

So, for android phones, just set the audio bit rate bigger, you will get the better quality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文