views:

3175

answers:

3

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.

thank you,

L.

A: 

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

Dave Gamble
Didn't help. Thank you!
Leachy Peachy
+5  A: 

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.

Anil Sivadas
I will give this a shot. Thanks Anil!L.
Leachy Peachy
+1  A: 

you can use dirac-2 from dsp dimension for real time 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."

Aran Mulholland