Re: AUHAL for input - format change?
Re: AUHAL for input - format change?
- Subject: Re: AUHAL for input - format change?
- From: Doug Wyatt <email@hidden>
- Date: Mon, 25 Apr 2005 11:21:23 -0700
On Apr 23, 2005, at 22:38, Tim Dorcey wrote:
I had been using an AudioDevice ioProc to capture audio from the
default
input device. I just got a report that captured audio (from iSight
camera)
is garbled on Tiger. Not sure yet that problem is specific to my
app, but
decided it was probably time to upgrade to using AUHAL for input, as
recommended in TN2091.
My old code installs a deviceListenerProc to listen for changes in the
captured stream format, and reconfigure my AudioConverter
accordingly. I do
not see mention of how this is handled by AUHAL? TN2091 suggests
querying
the input stream format once at initialization, but it also says
that AUHAL
can only do "simple" conversions itself.
How do I know that AudioUnitRender is not going to start giving me
different
format audio midstream?
Um, it won't. If the hardware stream format changes, then AUHAL will
create/destroy AudioConverters as necessary to keep providing audio
in the format you gave it (or stereo interleaved 44.1 if you didn't
give it a format).
However, AUHAL won't work as expected if your client sample rate is
different from the hardware sample rate, since it's pushing samples
to you.
So you'll have to listen for the stream format notifications anyways
to keep your client sample rate the same as the hardware's (you can
still convert float->int and change the number of channels). And
there is a likelihood of dropped buffers during a format change (at
every level, the hardware, the driver, the HAL and AUHAL) so really,
as a user, one shouldn't change the rate during recording.
The really big thing AUHAL helps with is dealing with devices with
multiple streams -- it flattens them into an array of channels so you
don't have to.
Doug
_______________________________________________
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