OK, I've given up on thinking I can just connect the RemoteIOUnit's bus 1 output to an input of my MultiChannelMixer like this:
setupErr = AUGraphConnectNodeInput(auGraph, remoteIONode, 1, mixerNode, 0);
Instead, I've set up an input render callback on the RemoteIOUnit, similar to the CAPlayThrough example and Technical Note TN2091 < http://developer.apple.com/technotes/tn2002/tn2091.html>. Eventually, I'll copy samples received in this callback to a render callback on the mixer's input bus 0.
So, of course, that's proving difficult too. Here's where I set the callback:
FWIW, AudioInputState is a struct that I'm using to hold a pointer to the RemoteIOUnit and the received AudioBufferList*.
Problem now is in the callback method. It's almost identical to TN2091, except that it gets the RemoteIOUnit from my struct: Basically, what the debugger tells me is that every time I get the callback, inNumberFrames is passed in as 0. I assume that's the reason that the call to AudioUnitRender always returns -50, paramErr.
By comparison, CAPlayThrough seems to always get called back with 800 frames to render.
So, is there anything obviously stupid about how I've set up this callback?
Also, I don't see callbacks at all when running on the Simulator. Can I assume audio input only works on the device?
Thanks in advance for any ideas.
--Chris
On Apr 6, 2009, at 2:02 PM, William Stewart wrote: Right - so you just need to make a connection on one of your input buses of your mixer, to the output bus, element 1, of the aurio unit in your graph - that's your audio device input coming into your graph
That should work just fine (its how we also do this on the desktop with AULab for instance)
|