Get Hz frequency from audio stream on iPhone

后端 未结 3 414
后悔当初
后悔当初 2020-12-01 01:23

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 advanc

3条回答
  •  日久生厌
    2020-12-01 01:30

    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.

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

    Hope it helps.

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

提交回复
热议问题