Re: Setting the volumes for a headphone data source
Re: Setting the volumes for a headphone data source
- Subject: Re: Setting the volumes for a headphone data source
- From: Tim Hewett <email@hidden>
- Date: Thu, 14 Mar 2013 00:31:09 +0000
Jeff,
On 13 Mar 2013, at 19:00, email@hidden wrote:
> On Mar 12, 2013, at 6:15 PM, Tim Hewett <email@hidden> wrote:
>
>> Is there a way to set the volumes for a headphone data source (and even discover that such a data source exists programmatically) for the headphone port on a Mac's built-in audio device, when the headphones are not connected?
>
> No.
In the absence of being able to do this I figured a workaround, which is to set the headphone device volumes quite low and to compensate the software gains applied to the samples with a reciprocal value. Then if the user unplugs the headphones and then uses them again later at least they won't get a loud blast.
Unfortunately this doesn't seem to be so simple, in particular the built-in device in the MacBook mentioned previously seems to operate the relationship between scalar and dBs differently to other devices, at 0.25 it is at about -29dBs whereas others are at -16dB. All use the same transfer function, i.e. kPow2Over1Curve as defined in CAVolumeCurve.h. Setting the volume to 0.25 scalar and multiplying the samples by 4.0 doesn't achieve full volume. Is it possible to discover what multiplier is applied to the samples in the device drivers at the point of conversion from float to integer?
Tim.
_______________________________________________
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