views:

439

answers:

2

hi,

I'm trying to manipulate the speed (and pitch) of a sound while playing.

so i played around with iphone sdk's AudioUnit. downloaded iPhoneMultichannelMixerTest and tried to add an AUComponent to the graph (in this case a formatconverter). but i get (pretty soon) following error when building:

#import <AudioToolbox/AudioToolbox.h>
#import <AudioUnit/AudioUnit.h>

...

AUComponentDescription varispeed_desc(kAudioUnitType_FormatConverter, 
kAudioUnitSubType_Varispeed, kAudioUnitManufacturer_Apple);
^^
error: 'kAudioUnitSubType_Varispeed' was not declared in this scope.

any ideas why? the documentation on this topic doesn't help me at all (just api doc isn't very helpful when having no clue about the concept behind). there are no examples on how to wire these effects together and manipulating there properties...so maybe i'm totally wrong, anyway any hint is great.

thx for help.

A: 

kAudioUnitSubType_Varispeed - is only for use on OS X, not iphone OS.

Only pitch shifting support i have found on the iphone is with openAL. or you could use a third party one. I haven't been able to get this going in real time.

Aran Mulholland
A: 

If you want pitch control you can use the Finch sound engine (OpenAL). The pitch control slider is featured in the demo application.

zoul