Hi all,
I have now the same situation like Chris once had. I need one io node (for mic and speaker), one mixer unit and one converter unit. Each one has one input and one output. These three nodes should be connected to form a cycle connection. I have a problem with the connection between mixer node and converter node. It says always that this connection can not be made. I followed Chris's src code on the Pastie (http://pastie.org/445149) and also faced the same problems as Chris stated there. I would be appreciate if anyone could share your working code in this matter.Thank you,
Tu
The last line of the following code return the error code number -10861 which is an kAUGraphErr_InvalidConnection
error
err = AUGraphAddNode(state->myAudio->graph, &ioDesc, &ioNode);
err = AUGraphAddNode(state->myAudio->graph, &mixerDesc, &mixerNode);
err = AUGraphAddNode(state->myAudio->graph, &converterDesc, &converterNode);
//node connection
err = AUGraphConnectNodeInput(state->myAudio->graph, mixerNode, 0, ioNode, 0);
err = AUGraphConnectNodeInput(state->myAudio->graph, ioNode, 1, converterNode, 0);
err = AUGraphConnectNodeInput(state->myAudio->graph, converterNode, 0, mixerNode, 0);
err = AUGraphOpen(state->myAudio->graph);
err = AUGraphNodeInfo(state->myAudio->graph, ioNode, &ioDesc, &state->myAudio->ioUnit);
err = AUGraphNodeInfo(state->myAudio->graph, mixerNode, &mixerDesc, &state->myAudio->mixerUnit);
err = AUGraphNodeInfo(state->myAudio->graph, converterNode, &converterDesc,
&state->myAudio->converterUnit);
UInt32 numbuses = 5;
err = AudioUnitSetProperty(state->myAudio->mixerUnit, kAudioUnitProperty_ElementCount,
kAudioUnitScope_Input, 0, &numbuses, sizeof(UInt32) );
//the cross fader mixer callback
AURenderCallbackStruct callbackCrossFader;
callbackCrossFader.inputProc = &crossFaderMixerCallback;
callbackCrossFader.inputProcRefCon = state;
err = AUGraphSetNodeInputCallback(state->myAudio->graph, mixerNode, 0, &callbackCrossFader);
/****** err here = -10861 ******/