maybe something along these lines?
// get input device
AudioObjectID inputDevice;
UInt32 size;
AudioObjectPropertyAddress add = {kAudioHardwarePropertyDefaultInputDevice,
kAudioObjectPropertyScopeGlobal,, kAudioObjectPropertyElementMaster};
AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &add, 0, NULL,
&size);
AudioObjectGetPropertyData(kAudioObjectSystemObject, &add, 0, NULL, &size,
&inputDevice);
// get volume of input device
Float32 masterVolume;
add.mSelector = kAudioDevicePropertyVolumeScalar;
add.mScope = kAudioDevicePropertyScopeInput;
if (AudioObjectHasProperty(inputDevice, &add))
{
AudioObjectGetPropertyData(inputDevice, &add, 0, NULL, &size,
&masterVolume);
}
else
{
// no master, so try individual channels
add.mElement = 1;
Float32 leftVolume;
AudioObjectGetPropertyData(inputDevice, &add, 0, NULL, &size,
&leftVolume);
Float32 rightVolume;
add.mElement = 2;
AudioObjectGetPropertyData(inputDevice, &add, 0, NULL, &size,
&rightVolume);
}
> On Dec 16, 2014, at 6:01 PM, John Joyce <[email protected]>
> wrote:
>
> Any pointers on how to detect the built-in input's input volume? (as labeled
> in System Preferences)
> I’d like my use of AVAudioEngine to set the default inputNode volume at app
> launch to something reasonable based on the built-in input’s input volume.
> That is, keep it low if the System Preferences settings are high.
> This would be even better if there’s a way to detect whether it is the
> built-in mic and not currently headphones or other external mic.
> Detect if the self switching audio jack plugged in?
>
> Also, any notifications to subscribe to on those System Preferences settings
> changing?
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/coreaudio-api/matt%40sonomatics.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com
This email sent to [email protected]