Re: Deprecated AudioStream functions...
Re: Deprecated AudioStream functions...
- Subject: Re: Deprecated AudioStream functions...
- From: Dave Fernandes <email@hidden>
- Date: Fri, 06 Jan 2012 14:06:52 -0500
Use AudioObjectGetPropertyData() to get the streams for the device (kAudioDevicePropertyStreams property), and then get the physical format from the stream, again using AudioObjectGetPropertyData with the kAudioStreamPropertyPhysicalFormat property.
Dave
On 2012-01-06, at 1:21 PM, John Allsup wrote:
> Hi,
>
> Thanks for your reply.
>
> I'd worked the bit below from the sample code. That gets an array of device ID's.
>
> What I want to do is to change the sample format of a device's output (or input). I guessed that one uses the AudioStream*Property family of functions, but these are now deprecated. What do you use to get the sample format of an output device? (And how do you get a list of available formats and choose from it?)
>
> Thanks,
>
> John
>
> On 06/01/12 14:54, Daniel Tapie wrote:
>> Hi John,
>>
>> This is what you need to call instead: a combination of AudioObjectGetPropertyDataSize and AudioObjectGetPropertyData.
>>
>>
>> UInt32 propsize;
>> AudioObjectPropertyAddress aopa;
>> aopa.mSelector = kAudioHardwarePropertyDevices;
>> aopa.mScope = kAudioObjectPropertyScopeGlobal;
>> aopa.mElement = kAudioObjectPropertyElementMaster;
>> verify_noerr(AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &aopa, 0, NULL, &propsize));
>>
>>
>>
>> int nDevices = propsize / sizeof(AudioDeviceID);
>> AudioDeviceID *devids = new AudioDeviceID[nDevices];
>> verify_noerr(AudioObjectGetPropertyData(kAudioObjectSystemObject, &aopa, 0, NULL, &propsize, devids));
>>
>>
>> Hope this helps !
>>
>> Best regards,
>>
>>
>> Daniel Tapie
>>
>>
>> On 6 Jan 2012, at 15:36, John Allsup wrote:
>>
>>> Hi All,
>>>
>>> Just rejoined this list after a long time doing things not involving
>>> CoreAudio.
>>>
>>> I note in Snow Leopard that the AudioStreamGetProperty function and
>>> friends are deprecated. What is the new way of dealing with audio devices?
>>>
>>> I am trying to write a simple utility that changes a devices output bit
>>> depth (since Snow Leopard has this nice way of defaulting my USB
>>> monitors interface to 8bit when 16bit is available). Can anybody
>>> suggest the correct way of going about this?
>>>
>>> Thanks,
>>>
>>> John
>>>
>>>
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> 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