How would one shift Octave up or down on the audio buffer level? Or is there a library function for this? Is there a library or possibly an allowed (iOS) 3rd party library for determining some attributes of an audio file? Such as BPM, Key etc. Or how would one determine these things? How is a beat distinguished in an audio buffer? How would the key of the audio be extracted from the audio data?
1 Answers
For shifting pitch by an octave on an iOS device, there is currently no built-in audio unit function for this. But there appears to be some available commercial time-pitch modification libraries, such as one from Dirac.
There appears to be some open source iOS DSP code titled as pitch detectors; but, beware, as some of that code appears to be only good at FFT frequency estimation, which is poor at music pitch and key estimation in many cases. Look for pitch detection/estimation code that uses autocorrelation, cepstrum analysis, or other more advanced methods.
For BPM estimation, see the answers to these questions: How to detect the BPM of a song in php and Beats per minute from real-time audio input .
None of the above is trivial, and to do it well may still be considered a graduate level research topic in DSP and music signal processing.
UPDATE: iOS 6 includes the AUNewTimePitch Audio Unit, which can do a non-high-quality time-pitch modification to shift pitch by 2X.
-
Thanks, I will have a look at these. – some_id Jun 24 '12 at 21:35