从 iPhone 上的音频流中获取赫兹频率 [英] Get Hz frequency from audio stream on iPhone

查看:29
本文介绍了从 iPhone 上的音频流中获取赫兹频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 iOS 上的音频流(音乐)获取 Hz 频率值的最佳方法是什么?Apple 提供的最好和最简单的框架是什么?提前致谢.

What would be the best way to get Hz frequency value from audio stream(music) on iOS? What are the best and easiest frameworks provided by Apple to do that. Thanks in advance.

推荐答案

SO 上经常会问这样的问题.(我在这里回答了一个类似的问题)所以我写了一个小教程,里面的代码你甚至可以在商业和闭源应用程序.这不一定是最好的方式,但这是很多人都理解的方式.您必须根据每个短音乐片段的赫兹平均值"的含义对其进行修改.例如,您是指基本音高还是频率质心.

Questions like this are asked a lot here on SO. (I've answered a similar one here) so I wrote a little tutorial with code that you can use even in commercial and closed source apps. This is not necessarily the BEST way, but it's a way that many people understand. You will have to modify it based on what you mean by "Hz average value of every short music segment". Do you mean the fundamental pitch or the frequency centroid, for example.

您可能希望按照另一个答案的建议在加速框架中使用 Apple 的 FFT.

You might want to use Apple's FFT in the accelerate framework as suggested by another answer.

希望有帮助.

http://blog.bjornroche.com/2012/07/frequency-detection-using-fft-aka-pitch.html

这篇关于从 iPhone 上的音频流中获取赫兹频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆