I'm writing an iPhone app where I want to mix audio from the mic with other sources and play it out immediately.
I've built an AUGraph with a RemoteIO unit at the end for output, and a mixer in front of it, to which I've hooked up a couple renderers on separate buses, and it works fine.
Now I want to add another instance of RemoteIO at the beginning of the graph to record from the mic and make that another input to the mixer. So I attempt to create another node with the same AudioComponentDescription as the "output" node, but when I try to add the node, I get OSStatus -10862, which is kAUGraphErr_OutputNodeErr:
Audio processing graphs can only contain one output unit. This error is returned if trying to add a second output unit or if the graph’s output unit is removed while the graph is running.
OK, fair enough, but what I'm trying for is a RemoteIO input unit... is the catch that I somehow need to create the input RIO unit differently? Or is it that I can only ever have one RIO unit and need somehow get it into two nodes: once for output at the end of the graph and once for input at the beginning?
FWIW, I tried changing the component description's type from kAudioUnitType_Output to kAudioUnitType_Generator, not really expecting that to work, and indeed I got OSStatus -2005.
Thanks in advance for suggestions!
--Chris
|