Re: Volume data in 16bit integer data
Re: Volume data in 16bit integer data
- Subject: Re: Volume data in 16bit integer data
- From: Laurent Cerveau <email@hidden>
- Date: Thu, 7 Feb 2002 16:33:53 +0100
On Thursday, February 7, 2002, at 03:32 PM, Joe Chang (l%l,m8) wrote:
>
Suppose I convert 16bit data into 32bit float (0.0~1.0), and send it
>
to the device. What is actually sent to the device?
>
I guess it's not the 32bit float (0.0~1.0) value. It's converted into
>
something else which the device can understand.
This depends on the capabilities of the device. The driver is having a
set of IOAudio controls that corresponds to control on the hardware.
In the case of volume the following happens : when instantiated the
IOAudioControl publishes the capabilities of the hardware ,like :
"this piece of hardware goes from n dB to M dB in X steps. (in fact
you even publish more complex type scales) "
In the case of the builtin driver this info is encoded in the plist file
for each plugin, In the case of USB, and if I remember well, the driver
queries the USB device for its capabilities (a few descriptors :-)) and
set up the IOAudioLevel controls. You can look at this info direcly in
the propeorties of the IORegistry entry for the driver.
At the user level (the HAL), the programmer can either control the
device using a [0 - 1] floating point scale or using the dB scale. But
remember that the [0 - 1] is really a "facility" for easier and lighter
programming. What happens in reality at the hardware level is known only
if you keep the dB scale in the game. But in absolute [0- 1] does not
mean a lot (neither does a 16 bit integer, like in the Sound Manager by
the way). The beauty of the HAL is that you always know how much
amplification is applied by having also the dB scale associated.. and
that you also keep a simple [0-1] "API-scale" for programming.
>
(But please remember, that this data will NOT actually
>
change the volume factor of the device, but change its setting.)
Do you mean you want to pass an attribute which does not correspond to
one of the HAL property, (like volume or mute)?
Laurent
Laurent Cerveau
Applications Division
Apple Computer Inc.
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.