Android 麦克风拾取特定音调
您好,我想知道是否可以使用 android 音调生成器类在一个设备中创建音调并在另一台设备中监听相同的音调。如果可能的话,我还有其他几个问题。
考虑到背景噪音,是否可以只听这个特定的音调?
这个过程会占用大量资源吗?
我可以使用人耳听不见或接近人耳的声音吗?
最后,我可以使用只能在距离发送设备几英尺的地方听到的音调吗?
非常感谢你们花时间参加的伙计们和女孩们:)
编辑> 感谢您添加音频处理标签 sabastian。更好的描述。
Hello I was wondering if using the android tone generator class would it be possible to create a tone in one device and listen for this same tone in another device. If this is possible I do have a few other questions.
Taking backround noise into consideration is it possible to listen for only this specific tone?
Would this process be resource intensive?
Could I use a tone that would be inaudable to the human ear or close to it?
Lastly could I use a tone that could only be heard with a couple of feet from the sending device?
Thanks very much for yer time guys and girls :)
Edit >
Thanks For adding the audio processing tag sabastian. Much better discription.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这将是 CPU 密集型的。
方法非常简单:您需要一个永久记录器,将接收到的数据放入 FFT(快速傅立叶变换)中。 FFT 基本上只做一件事:将音频分成频率/功率范围。通过此“背景噪音已清除”结果,您可以检查“是否有 1000Hz 的音调播放至少 2 秒”等内容 - 并采取相应措施。
这里有一个合理的速度 FFT 实现:http://www.badlogicgames.com/wordpress/? p=449
FFT 还可以用于(实际上,使用 IS)来检测双音拨号 (DTMF) - 同时使用 2 个频率比仅使用一个频率要好得多(因为错误率显着下降,并且您可以缩短音频发送的持续时间) /检测)。
“听不见”是不可能的,因为(a)扬声器无法产生这样的声音(b)您的采样率受到限制 - 因此在产生和记录如此高的频率方面也受到限制。
“几英尺”将被自然地强加(不是很大声的扬声器,不是很好的麦克风)。
It would be CPU intensive, yes.
The way to it is quite simple: you need a permanent recorder which puts the received data into a FFT (fast fourier transform). FFT basically does one thing: splits the audio into a frequency/power-scale. With this "background noise cleaned" result you can check things like "was there a tone with 1000Hz playing for at least 2 seconds" - and act accordingly.
There is a reasonable speed FFT implementation here: http://www.badlogicgames.com/wordpress/?p=449
FFT can also be used (actually, IS used) for detection of dualtone dialing (DTMF) - 2 frequencies at same time is much better than just using one (as the error rate drop significantly and you can go to shorter duration for the tone sending/detecting).
"Inaudible" won't be possible, as (a) the speaker can not produce such sounds (b) you are limited in sampling rate - so also limited in both producing and recording such high frequencies.
"couple of feet" will be naturally imposed (not very loud speaker, not very good microphone).
看看另一个问题:“Android:需要录制麦克风输入”。我认为你可以根据你的任务修改它,然后使用声音字节你可以进行过滤或 FFT。
希望有帮助
Have a look at this other question: "Android: Need to record mic input". I think you can modify that for your task, then with sound bytes you can have filtering or FFT.
Hope it helps