Re: Multiple outputs for the same source
Re: Multiple outputs for the same source
- Subject: Re: Multiple outputs for the same source
- From: William Stewart <email@hidden>
- Date: Wed, 25 May 2005 12:29:24 -0700
On 25/05/2005, at 12:13 PM, Felipe Baytelman wrote:
Thanks Bill:
I'm sending this again, now with copy to the list, so then it
will be stored for other people to consult it.
I have a final question. If this is my AU chain setup (built
backwards, from output to source):
AUGraphConnectNodeInput(graph, stereoNode, 0, outputNode, 0);
AUGraphConnectNodeInput(graph, eqTNode, 0, stereoNode, 0);
AUGraphConnectNodeInput(graph, eqMNode, 0, eqTNode, 0);
AUGraphConnectNodeInput(graph, eqBNode, 0, eqMNode, 0);
AUGraphConnectNodeInput(graph, mVarispeedNode, 0, eqBNode, 0);
//you can now initialize the graph
err = AUGraphInitialize(graph);
if (err)
return NO;
// Set up our callback to feed data to the AU.
inputCallbackStruct.inputProc = renderCallback;
inputCallbackStruct.inputProcRefCon = self;
err = AudioUnitSetProperty(varispeedUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input,
0,
&inputCallbackStruct,
sizeof(inputCallbackStruct));
Then, for playing I just call AUGraphStart(graph);
Let's suppose I modify this to add the splitter, and I connect the
splitter to two different soundOutputs
My confusion comes here, because I'm not calling any RENDER, just
starting the graph and that's it.
So, if I call AUGraphStart... will it automatically send RENDER to
both soundOutpus?
Or I would have to do it more explicitly?
Ah - I see the confusion.
By definition, a graph can only have one output unit - that is the
graph's head. In the case you describe above, this is a device output
unit, which automatically runs with the I/O Proc of the device it is
attached to. So, you can't really get below that.
You can certainly add the splitter into the graph, but it would have
to be above the output unit in the signal chain....
So, lets back up a bit - what are you trying to achieve?
Do you want the audio you are generating to go out to the device (ie.
to play it) and you also want to do something else with it (say
write it to a file)? Or, do you want to just do some more extensive
processing on the audio before you play it. Neither of these options
are mutually exclusive.
To get some idea of how you can do this, have a look at the AU Lab
application. Add a couple of effects, audio input (or instrument or
generator sources)... As you do this, in the debug menu do a Print
Session - you'll get a whole lot of state dumped to the console
output - that should help you figure out something about what you
need to do. You can also record a file of the audio as it is being
played out - that is done by syphoning off the audio from the Graph's
Post-Render callback, and using the ExtendedAudioFile API to write
the file to disk in another thread...
HTH
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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