本文介绍了是可以通过MediaRecorder或其他类来获取当前样本幅度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个媒体记录器,并希望记录从话筒媒体,并得到
它的幅度样本。
我想尝试以获得正确的电流幅值瞬间
调用一些API时。
但在MediaRecorde只是一个API获取幅度:
getMaxAmplitude,并用它来得到最大的绝对振幅
自上次调用测量。
这有可能瞬间获取当前样本幅度
从话筒MediaRecorder或其他类?

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

谢谢,
最好的祝福,

Thanks,Best regards,Chen

推荐答案

有关MediaRecorder.getMaxAmplitude文档说:

The documentation for MediaRecorder.getMaxAmplitude says:

返回,因为这种方法最后调用被采样的最大绝对幅度。只有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.

这篇关于是可以通过MediaRecorder或其他类来获取当前样本幅度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 10:20