Re: Setting Sample Rates
Re: Setting Sample Rates
- Subject: Re: Setting Sample Rates
- From: Jeff Moore <email@hidden>
- Date: Mon, 14 Jan 2002 14:47:23 -0800
on 1/14/02 12:59 PM, Jim Dolan <email@hidden> wrote:
>
I have a quick question about streams...
>
I notice that Daisy uses AudioStreamSetProperty with channel 0 to set stream
>
information. I assume this apply's to all channels in the stream?
Setting the format for any channel at the stream level affects all the
channels in that stream. Remember, a stream is defined to be a single buffer
of interleaved channels whose format is the same. It is possible to have
different formats for each stream attached to a device however.
>
Could I do the same thing using the AudioDeviceSetProperty? By using 0 for
>
the channel and specifying input or output, would that apply to all input or
>
output streams in the device or is this just not valid? Please explain?
Changing the format on channel 0 using AudioDeviceSetProperty is a special
case for backward compatibility that sets the format of the first stream
attached to the device in the given direction.
Otherwise, when you use AudioDeviceSetProperty to change the format of a
channel other than 0, the HAL figures out what stream that channel is in and
passes the request off to that stream.
>
I also notice that setting the actual or physical stream format often effect
>
each other - is this supposed to happen?
Absolutely.
The physical format is the format that is coming in or going out the wire.
The actual format is the format you do you see in your IOProc. The two are
very much related as the actual format _is_ the physical format except the
HAL modifies the actual format for linear PCM data to reflect that it always
expects 32 bit floats in the IOProc. This is why the HAL has to have two
concepts of the current format and why a change to one usually results in a
change to the other.
Most of this stuff is written down after a fashion in the Theory of
Operation comment at the top of <CoreAudio/AudioHardware.h>. Let me know if
there are any clarifications you'd like to see...
--
Jeff Moore
Core Audio
Apple