Re: How do you get the native bit-depth of the input device?
Re: How do you get the native bit-depth of the input device?
- Subject: Re: How do you get the native bit-depth of the input device?
- From: Jeff Moore <email@hidden>
- Date: Fri, 10 Aug 2007 17:06:48 -0700
On Aug 10, 2007, at 4:49 PM, Dave Fernandes wrote:
Thanks! It took me a while to figure out how to get this format
info, but I think it is working. I'm using the "master channel" of
the AudioDevice to get the AudioStream to get the format. Is this
correct?
You're close. Format info in the HAL is handled differently than it is
in AUHAL. Each audio device has some number of streams and each stream
has it's own format. Thus, the format of the audio device is actually
a vector of ASBDs, one for each stream. So, to get the format of the
device, you'd do the following (in pseudo code):
Get the list of streams for the device
For each stream do
Get the physical format of the stream
By just getting the format of the first stream, you are only getting a
partial picture of the format of the device. For devices that have
only one stream in a given direction (like the built-in hardware),
this will be fine. But for more complex hardware, it will leave you
with just part of the info.
I can't find any documentation on what exactly a master channel is.
This is covered somewhat in <CoreAudio/AudioHardware.h>. But the short
answer is that the HAL always numbers channels in streams starting
with number 1. Number 0 is reserved for the "master" channel which is
useful for controls or properties that apply to the entire scope or
object involved.
In the case of the stream format stuff, getting the various device
related format properties on the master channel gets you the
information about the first stream of the device in the given direction.
Dave
On Aug 6, 2007, at 2:57 PM, William Stewart wrote:
In AudioHardware.h there are format descriptor properties for the
virtual and physical formats of the device. The virtual format is
normally the canonical Float32. The physical format is whatever the
device is using.
On 02/08/2007, at 2:24 PM, Dave Fernandes wrote:
The AudioOutputUnit nicely provides a stream of Float32 samples.
But I would like to choose the bit-depth of the file I am
recording to based on the precision of the input device. So how
can I determine this precision? The
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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