Re: Sample rates and AUGraphs
Re: Sample rates and AUGraphs
- Subject: Re: Sample rates and AUGraphs
- From: William Stewart <email@hidden>
- Date: Fri, 21 Jan 2005 12:21:38 -0800
On 21/01/2005, at 7:28 AM, Robert Grant wrote:
I'm sure everyone is at NAMM but here goes anyway...
I seem to have gotten myself in a tangle dealing with setting the
sample rate on AUs in a graph. It seems to work some of the time with
some AUs but not universally.
And if I create a node (in an already initialized and running graph) I
imagined that the node would inherit at least the broad
characteristics of the graph (such as sample rate) but it appears not.
Nope - the node's AU is just opened. Where is the API that says a Graph
is running at a particular sample rate? What would that mean if you had
converter AU's in the graph to convert between different sample rates?
This is a semantic you have to manage.
But setting the sample rate after creating the node in a running graph
seems to cause a blockage (i.e. the AU is no longer being pulled) with
the Apple Effect AUs (which I believe to be the gold standard) even
though some others (digitalfishphones for example) are happy....
You are changing the format which exists between the output of one AU
and the input of another.... so, both sides have to be changed, and the
AU's have to uninitialized to have the format changed. If you have a
graph that is running at a particular sample rate, its actually pretty
easy to do this:
(1) Stop the graph
(2) Uninitialize the graph
(3) Cache all the connections of the graph
(4) Disconnect all the graph
(5) Iterate through the connections and set the sample rate on each
side of the connection (remember each connection is unique, so you just
do both sides)
(6) Reconnect the graph
(7) Initialize the graph
(8) Start the graph
One possibly better alternative to (5) is to iterate through all of the
nodes of the graph, and for each node get its inputs and outputs, and
set each of these to the new sample rate (you have to special case the
output unit here of course, because the device sides of the AUHAL won't
let you set their formats).. This takes care of the fact that you might
have an AU that has inputs or outputs that aren't actually connected...
Bill
So some general guidance would be handy - at the moment I don't feel I
can see the forest for the trees.
Thanks,
Robert.
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement [GSV]
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
________________________________________________________________________
__
_______________________________________________
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