How to detect sound frequency / pitch on an iPhone

2019-02-09 08:45发布

I'm trying to find a way to detect sound frequency being recorded by iPhone's Microphone. I'd like to detect whether the sound frequency is going up or down.

6条回答
戒情不戒烟
2楼-- · 2019-02-09 09:09

I wrote some code with explanation for tracking pitch in C. It uses the FFT, which is not the optimal method, but you can see if this is good enough for your application. Ideally, you'd replace the FFT with something hardware accelerated.

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

https://github.com/bejayoharen/guitartuner

查看更多
forever°为你锁心
3楼-- · 2019-02-09 09:16

Note that the SC_listener does not work on iPhones running iOS 3.0 or above, check in AVAudioRecorder and FFT. It somehow works in the simulator though....

查看更多
手持菜刀,她持情操
4楼-- · 2019-02-09 09:17

To detect frequency you should check out the fast Fourier transform (FFT) algorithm.

查看更多
Melony?
5楼-- · 2019-02-09 09:19

For simple pitch detection, I think the FFT is good enough. Try look into Aurio Touch 2 and vDSP reference in accelerate framework.

查看更多
不美不萌又怎样
6楼-- · 2019-02-09 09:22

you can try to use SCListener. It's a small open-source class and very easy to use

EDIT: The formatter does not like the _ in the name. Here is the link. http://github.com/stephencelis/sc_listener

查看更多
三岁会撩人
7楼-- · 2019-02-09 09:25

Beethoven looks like a good option: https://github.com/vadymmarkov/Beethoven

查看更多
登录 后发表回答