Slider values on an Input Volume(Gain) Control
Slider values on an Input Volume(Gain) Control
- Subject: Slider values on an Input Volume(Gain) Control
- From: Robert Penland <email@hidden>
- Date: Mon, 12 May 2003 16:17:29 -0700
I'm having a little problem with the values that get sent to the gain
control of my AudioInput driver. If I create the control with the following
line
myGainControl = IOAudioLevelControl::CreateVolumeControl(myCurrent,
myMin, myMax, 0,(18 <<16),
kIOAudioControlChannelIDAll,kIOAudioControlChannelNameAll,0,kIOAudioControlU
sageInput);
I get a nice linear mapping from myMin to my Max when the gain control
slider in the audio preferences pane as the slider is moved from min to max.
Since, my input hardware can also attenuate the input signal I thought I
could modify the call as follows:
myGainControl = IOAudioLevelControl::CreateVolumeControl(myCurrent,
myMin, myMax, (-18 << 16),(18<<16),
kIOAudioControlChannelIDAll,kIOAudioControlChannelNameAll,0,kIOAudioControlU
sageInput);
and still get a linear mapping from myMin to myMax, and whoever cared in the
system would know that the input was also getting attenuated. If I do this
however, the mapping of slider values from the audio preferences pane gain
slider is no longer linear to my hardware. It almost looks like it is some
sort of logrithmic relationship with the lower half more heavily weighted
than the upper half. Can someone explain why this happens with a negative
value for the min dB setting ?
Thanks,
Rob
_______________________________________________
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.