Re: Setting volume levels?
Re: Setting volume levels?
- Subject: Re: Setting volume levels?
- From: Jeff Moore <email@hidden>
- Date: Thu, 26 Jun 2003 12:55:13 -0700
The reason why is that the hardware provides a range of discreet values
which the HAL normalizes out to be between 0 and 1. So if you set a
value that is "between" a pair of hardware steps, the HAL floors it to
the nearest hardware step.
On Thursday, June 26, 2003, at 12:08 PM, Jim Dolan wrote:
If I run the following code - why do I get different values in the
last line?
It does not matter what value I feed in, I always get something less?
I
thought maybe it was ramping but the value always seems to be less
than, no
matter which direction I change the volume to.
// Set the new level
Float32 fVolume = 0.59;
Float32 fVolume2 = 0.0;
UInt32 dataSize = sizeof(Float32);
AudioDeviceSetProperty( iDeviceID, NULL, actualChannel, isInput,
kAudioDevicePropertyVolumeScalar, sizeof( Float32 ), &fVolume );
AudioDeviceGetProperty( iDeviceID, actualChannel, isInput,
kAudioDevicePropertyVolumeScalar, &dataSize, &fVolume2 );
printf( "Volume: %f %f\n", fVolume, fVolume2 );
Volume: 0.590000 0.586691
_______________________________________________
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.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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.