Re: Custom Audio Units on the iPhone
Re: Custom Audio Units on the iPhone
- Subject: Re: Custom Audio Units on the iPhone
- From: Thomas Zoechling <email@hidden>
- Date: Wed, 26 Nov 2008 19:30:05 +0100
I finally got the callback working. Thank you all for helping out!
Pierre gave the final hint:
Change outputDescription.componentSubType from
kAudioUnitSubType_GenericOutput to kAudioUnitSubType_RemoteIO
And all should be fine.
I now create the basic graph with:
OSErr err = noErr;
err = NewAUGraph(&graph);
NSAssert(err == noErr, @"Error creating graph.");
mixerDescription.componentFlags = 0;
mixerDescription.componentFlagsMask = 0;
mixerDescription.componentType = kAudioUnitType_Mixer;
mixerDescription.componentSubType = kAudioUnitSubType_AU3DMixerEmbedded;
mixerDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
err = AUGraphAddNode(graph, &mixerDescription, &mixerNode);
NSAssert(err == noErr, @"Error creating mixer node.");
outputDescription.componentFlags = 0;
outputDescription.componentFlagsMask = 0;
outputDescription.componentType = kAudioUnitType_Output;
outputDescription.componentSubType = kAudioUnitSubType_RemoteIO;
outputDescription.componentManufacturer = kAudioUnitManufacturer_Apple;
err = AUGraphAddNode(graph, &outputDescription, &outputNode);
NSAssert(err == noErr, @"Error creating output node.");
err = AUGraphOpen(graph);
NSAssert(err == noErr, @"Error opening graph.");
err = AUGraphConnectNodeInput(graph, mixerNode, 0, outputNode, 0);
NSAssert(err == noErr, @"Error connecting mixer to output.");
//wire up the callback (for >1 Callbacks, increment the bus number)
AURenderCallbackStruct callback;
callback.inputProc = TestCallback;
err = AUGraphSetNodeInputCallback(graph, mixerNode, 0, &callback);
NSAssert(err == noErr, @"Error setting render callback.");
CAShow(graph);
err = AUGraphInitialize(graph);
NSAssert(err == noErr, @"Error initializing graph.");
err = AUGraphStart(graph);
NSAssert(err == noErr, @"Error starting graph.");
CAShow(graph);
--thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden