Re: Replacements for AudioHardwareGetPropertyInfo() et al.?
Re: Replacements for AudioHardwareGetPropertyInfo() et al.?
- Subject: Re: Replacements for AudioHardwareGetPropertyInfo() et al.?
- From: Rick Mann <email@hidden>
- Date: Thu, 13 Jul 2017 18:37:35 -0700
Thanks, I’ll check it out.
Can’t call the deprecated one from Swift because it won’t let me (anything
deprecated before 10.9).
--
Rick Mann
email@hidden
> On Jul 13, 2017, at 18:30, Chris Adamson <email@hidden> wrote:
>
> IIRC, the AudioObject* APIs replaced AudioHardware* some time ago. It’s been
> a while since I’ve done anything that uses them, but I did notice this in the
> last version of the Learning Core Audio sample code that I uploaded as errata:
>
> // AudioHardwareGetProperty() is deprecated
> // CheckError
> (AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice,
> //
> &propertySize,
> //
> &defaultDevice),
> // "Couldn't get default input device");
>
> // AudioObjectProperty stuff new in 10.6, replaces
> AudioHardwareGetProperty() call
> // TODO: need to update ch08 to explain, use this call. need
> CoreAudio.framework
> AudioObjectPropertyAddress defaultDeviceProperty;
> defaultDeviceProperty.mSelector =
> kAudioHardwarePropertyDefaultInputDevice;
> defaultDeviceProperty.mScope = kAudioObjectPropertyScopeGlobal;
> defaultDeviceProperty.mElement = kAudioObjectPropertyElementMaster;
>
> CheckError (AudioObjectGetPropertyData(kAudioObjectSystemObject,
>
> &defaultDeviceProperty,
>
> 0,
>
> NULL,
>
> &propertySize,
>
> &defaultDevice),
> "Couldn't get default input device");
>
>
> Also, calling AudioObject from Swift will work just as well/poorly as
> AudioHardware. Any C function in a public API can be called from Swift just
> fine… it’s just highly unintuitive Swift since it uses lots of inout and free
> functions and UnsafeMutableRawPointerWillKillYouInYourSleep and all that.
>
> Hopefully that’ll at least get you pointed in the right direction. Sorry the
> docs aren’t better.
>
> —Chris
>
>
>> On Jul 13, 2017, at 8:13 PM, Rick Mann <email@hidden> wrote:
>>
>> Apple's docs are sorely lacking. A whole suite of APIs is deprecated, with
>> no indication of what to use in their stead, and no accessibility from Swift:
>>
>> https://developer.apple.com/documentation/coreaudio/1580716-audiohardwaregetpropertyinfo
>>
>> What's the replacement set of APIs for switching the current audio input on
>> macOS?
>>
>> Thanks,
>>
>> --
>> Rick Mann
>> email@hidden
>>
>>
>> _______________________________________________
>> 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
>
_______________________________________________
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