是否可以通过 MediaRecorder 或其他类获取当前样本幅度

发布于 2024-08-16 22:04:06 字数 195 浏览 2 评论 0原文

我有一个媒体录音机,想要从麦克风录制媒体并获取 它是幅度样本。 我想尝试立即获得正确的当前幅度 当调用一些API时。 但 MediaRecorde 中只有一个 API 用于获取幅度: getMaxAmplitude,用于获取最大绝对幅度 自上次调用以来测量。 是否可以瞬时获取当前采样幅度 通过 MediaRecorder 或其他麦克风类?

谢谢, 此致, 陈

I have a media recorder, and want to record a media from mic and get
it's amplitude sample.
I want to try to get the correct and current amplitude instantaneously
when calling some API.
But there is just one API in MediaRecorde for getting amplitude:
getMaxAmplitude, and it is used to get the maximum absolute amplitude
measured since the last call.
Is that possible to get the current sample amplitude instantaneously
by MediaRecorder or other class from mic?

Thanks,
Best regards,
Chen

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

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

发布评论

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

评论(1

策马西风 2024-08-23 22:04:06

MediaRecorder.getMaxAmplitude 的文档说:

返回自上次调用此方法以来采样的最大绝对幅度。仅在 setAudioSource() 之后调用此函数。

因此,您可以在很短的时间间隔内采样两次并查看第二个值。这实际上是一个瞬时样本。

The documentation for MediaRecorder.getMaxAmplitude says:

Returns the maximum absolute amplitude that was sampled since the last call to this method. Call this only after the setAudioSource().

Thus, you could just sample twice over a small time interval and look at the second value. That would effectively be an instantaneous sample.

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