Re: CAPlayThrough questions
Re: CAPlayThrough questions
- Subject: Re: CAPlayThrough questions
- From: William Stewart <email@hidden>
- Date: Thu, 8 Oct 2009 10:54:10 -0700
CAPlayThrough is code aimed at doing I/O between 2 audio devices that
are not synchronised (or they maybe, but the worst case assumption is
that they aren't).
The Varispeed is used as way to adjust the consumption of the input
device's audio by the output device.
So, the Varispeed in CAPlayThrough does two things:
(1) if there is a difference between the sample rates of the input and
output device, the varispeed AU does a resample
- this is a setting that is made and is constant through the lifetime
of the I/O operation (presuming the devices involved don't change)
(2) As the devices involved may NOT be synchronised, a further
adjustment is made over time, by varying the rate of playback between
the two devices. This rate adjustment is made by looking at the rate
scalar in the time stamps of the two devices. The rate scalar
describes the measured difference between the idealised sample rate of
a given device (say 44.1KHz) and the measured sample rate of the
device as it is running - which will also vary. This adjustment is
made by tweaking the rate parameter of the varispeed.
If you don't do the corrections to the rate parameter, then the two
devices can drift apart over time.
As far as processing - I would add the processing on the output side,
and you can put effects units, etc, here to do whatever you would like
to the audio as it is played out. The effect unit would be attached to
the output unit, and would ask for as much input data as the current
output unit does.
HTH
Bill
On Oct 8, 2009, at 5:47 AM, Eyal Redler wrote:
Hi,
I want to write an Audio Unit hosting applications that will have a
graph like this:
(User Selectable Input)->(My Custom AU - not user selectable)->
(Possibly other user selectable AU)->(User Selectable Output)
On the surface CAPlayThrough demonstrates the abilities I'm looking
for but it contains a few things that make it more complex then what
I would have intuitively think. My initial thought was that I could
just build the graph like the graph above (input unit->my unit->some
additional unit->output unit) and let the graph run but
CAPlayThrough does a lot more and I'm not sure if the additional
complexities are needed to make this work or just to demonstrate
other concepts. Specifically, I'm wondering about the following:
1. Why is the graph split between the input an output, why not do it
like this input->varispeed->output?
2. Why use a ring buffer and not a "normal" buffer?
3. Why use the varispeed audio unit, don't the au know how to
convert the sampling rate?
TIA,
Eyal Redler
------------------------------------------------------------------------------------------------
"If Uri Geller bends spoons with divine powers, then he's doing it
the hard way."
--James Randi
www.eyalredler.com
_______________________________________________
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
_______________________________________________
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