So, I'm looking at AUPlugin.h, in hopes of writing a custom Audio Unit for iPhone OS.
I suspect this is the way to go, rather than building a Mac effect unit from the Xcode template, ala the old custom Audio Units article < http://developer.apple.com/audio/audiounits.html>, since the Process() function in the article and the Xcode template takes floats, and I know the canonical format for iPhone is either unsigned ints ( kAudioFormatFlagsCanonical) or 8.24 fixed point ints (kAudioFormatFlagsAudioUnitCanonical). BTW, I'd love to use the former; I don't think the iPhone SDK has utility functions for working with fixed point.
There's an AudioUnitPlugInInterface that defines function pointers to a bunch of functions we'd expect of a unit: parameter and property getters and setters, Open(), Close(), Initialize(), etc. Critically, there's a Render(), whose signature matches AudioUnitRender(). So, I'm guessing, I define a struct for my unit's state data (passed in as "self" for all these calls), implement these functions, and voilĂ : I've got a custom unit. Woot, as the kids say.
Here's where I get the cold feet:
extern AudioComponent AudioComponentRegister( const AudioComponentDescription * inDesc, CFStringRef inName, UInt32 inVersion, CFPlugInFactoryFunction inFactory)
I haven't implemented CF plugins before, so I'm not sure what I do here. Do I implement a CFPluginFactoryFuction that returns my state struct, and then call AudioComponentRegister(), passing in a description for incoming matches, a name, a version, and a pointer to my CFPluginFactoryFunction?
Thanks. Yeah, I'm probably going to have followups.
--Chris
|