Re: multiple AUGraphs / Audio Hijack
Re: multiple AUGraphs / Audio Hijack
- Subject: Re: multiple AUGraphs / Audio Hijack
- From: William Stewart <email@hidden>
- Date: Thu, 2 Nov 2006 14:10:07 -0800
On 02/11/2006, at 8:45 AM, Brian Whitman wrote:
I have an app that needs two separate AUTimePitch nodes on separate
audio streams. We've previously discovered that you can't have two
AUTimePitch effects (or other format converters) in parallel at
different rates in the same AUGraph.
It depends on where you are getting your input from - that is, where
do these two time pitch AUs expect to get their input from and how
are you handling the buffering requirements for these two different
AUs running at different rates.
For instance, you can run AULab with two Generator tracks (say two
file players) and each of these tracks can have their own time pitch
running at different rates - this works just fine. In AULab we
restrict converter units just to tracks with Generator units because
they have no input requirement (that is they generate audio). We
don't have converter AUs on audio inputs because AU Lab doesn't
buffer its input.
To get around this, we just create two AUGraphs
(scheduledsoundplayer -> autimepitch -> mixer -> defaultoutput) and
two MusicPlayer instances (to schedule the stretch), and start
playing them at the same time.
So, this should work *depending* on what you want to do:
scheduledsoundplayer1 -> autimepitch1 -> mixer -> defaultoutput
scheduledsoundplayer2 -> autimepitch2 ->
The music player has a notion of a tempo (and a tempo scalar) and
this applies to *any* AUs that it is scheduling for. So, if in the
above scenario you are using the two AUTP to adjust playback rates,
then a single player can be used. If however, you are using the two
AUTP to adjust a notion of tempo as well, then the above scenario (2
AUTP, 1 MusicPlayer) won't work - you would need to have a single
rate control AU (AUTP) and a single player - where the rate control
of the AU and the tempo scalar of the MusicPlayer would need to be
kept in synch.
I am wondering if this is the supported method, or if it will end
up breaking in future OS or API revisions. I ask because I recently
tried to use Audio Hijack to capture the output of our app -- it
only recorded the first graph/musicplayer. I can still hear the
second graph out the speakers. I understand that AH is not using
any public API, but if it doesn't work with their app I'm worried
that there will be other configurations or future changes that'll
break our stuff.
- Is creating multiple AUGraphs/MusicPlayers (multiple 'speaker'
output units) in a single app supported?
Yes - in fact this is where subgraphs can help you out. You can have
one parent graph, and then have a sub graph for each AUTP where
changing its rate should also change its notion of tempo (so you have
a music player owning a sub graph) - the only trick is to master is
to make sure that the > 1 music players are started synchronously. We
don't have an API to do this, but you can work around this by:
Independently start the graph
In the graph's pre-render notification callback, start all your
players - as you are on the I/O thread at the base of the parent
graph, this will start each of the players on that I/O cycle
Bill
- If not, is there any other way to use two AUTimePitch objects in
parallel in a single graph?
-Brian
_______________________________________________
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
________________________________________________________________________
__
"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