Real-time Pitch Shifting on the iPhone

一世执手 提交于 2019-11-26 04:24:07

问题


I have a children\'s iPhone application that I am writing and I need to be able to shift the pitch of a sound sample using Core Audio. Does anyone have any example code I could look at where this is done. There are many music and game apps in the app store that do this so I know I am not the first one. However, I cannot find any examples of it being done.


回答1:


you can use dirac-2 from dsp dimension for pitch shifting on the iphone. quote: -

"DIRAC2 is available as both a commercial object library offering unlimited sample rates and phase locked multichannel support and as a free single channel, 44.1/48kHz LE version."




回答2:


use the soundtouch open source project to change pitch

Here is the link : http://www.surina.net/soundtouch/

Once you add soundtouch to your project, you have to give the input sound file path, output sound file path and pitch change as the input.

Since it takes more time to process your sound its better to modify soundtouch so that when you record the voice, directly give the data for processing. It will make your application better.




回答3:


I know it's too late for the person who asked but it is really a valuable link (As I found) for any one else who is looking for the solution of the same problem.

So Here we have latest DIRAC3 with it's own audio player classes which will take care of run time pitch and speed(explore for god knows what more) shifting. Run the sample and have huge round of applause for that.




回答4:


Try Dirac - it's the best technology out there and it's available on Win, Linux, MacOS X and iOS. We're using it in all our products (and a couple of others do as well, search for "Capo" on the App Store). They're at version 3 now which has seen a huge increase in performance since previous versions. Hope this helps.




回答5:


See: Related question

How much control over pitch do you need... could you precalculate all the different sounds? If the answer is yes, then you can just pick the right sounds and play them.

You could also use Audio Converter Services in conjunction with AVAudioPlayer, which will allow you to resample the audio (which will effectively repitch them, though they'll change duration).

Alternatively, as the related question points out, you could use OpenAL and AL_PITCH



来源:https://stackoverflow.com/questions/1100495/real-time-pitch-shifting-on-the-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!