Sorry for what's probably a simple question, but I'm distilling multiple Audio Graph examples I've seen, and my code seems to have a problem getting an audio unit from a RemoteIO node I've created. In other words, AUGraphNodeInfo puts NULL into *outAudioUnit, and I can't see what I'm doing wrong.
This is on iPhone SDK 2.2, on the simulator, with error-handling code removed:
NSLog (@"setUpRemoteIOAU"); AUGraph auGraph; AudioUnit remoteIOUnit; OSStatus setupErr = noErr;
// setup audio graph NewAUGraph(&auGraph);
// describe unit AudioComponentDescription audioCompDesc; audioCompDesc.componentType = kAudioUnitType_Output; audioCompDesc.componentSubType = kAudioUnitSubType_RemoteIO; audioCompDesc.componentManufacturer = kAudioUnitManufacturer_Apple; audioCompDesc.componentFlags = 0; audioCompDesc.componentFlagsMask = 0; // create new graph node for rio unit AUNode remoteIONode; setupErr = AUGraphAddNode(auGraph, &audioCompDesc, &remoteIONode); setupErr = AUGraphNodeInfo(auGraph, remoteIONode, NULL, &remoteIOUnit); NSLog (@"got remoteIOUnit = %@", remoteIOUnit);
The output is: 2009-04-01 14:48:16.887 AUGraphPlayerThrowaway1[6689:20b] setUpRemoteIOAU 2009-04-01 14:48:16.887 AUGraphPlayerThrowaway1[6689:20b] got remoteIOUnit = (null)
That said, the graph still runs, calls my render callback, and generates sound, but I haven't been able to set any properties on the unit (like its format), since it's null.
Thanks in advance...
--Chris
|