如何测量某人对着 iPhone 麦克风吹口哨的力度?
我想做一个应用程序来检测是否有人对着 iPhone 麦克风吹/吹口哨。 有点像 Smule 的 Ocarina。
有关于该主题的代码示例/教程吗?
I'd like to do an application that detects if someone is blowing/whistling into an iPhone mic.
Something like Ocarina by Smule.
Any code examples / tutorials on that subject?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AVAudioRecorder
应该可以满足您的要求。有关峰值功率的更多信息:http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioRecorder/peakPowerForChannel:这是一个如何使用它的好例子,密切关注峰值输入:http://www.mobileorchard.com/tutorial-detecting-when-a-user-blows-into-the-mic/
AVAudioRecorder
should do the trick for you. More info here on peak power: http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioRecorder/peakPowerForChannel:Here's a good example of how to use it, paying close attention to peak input: http://www.mobileorchard.com/tutorial-detecting-when-a-user-blows-into-the-mic/