Re: Reading supported sample rate in a device
Re: Reading supported sample rate in a device
- Subject: Re: Reading supported sample rate in a device
- From: Jeff Moore <email@hidden>
- Date: Thu, 9 Jun 2005 12:46:43 -0700
On Jun 9, 2005, at 10:06 AM, Stéphane Letz wrote:
On Panther we were using the kAudioDevicePropertyStreamFormats
property to get information on all supported formats, then read the
mSampleRate field to get the supported sample rate for each of the
stream format that was available.
On Tiger when used on an agregate device built with the USB iMic
(so that the 2 input/output internal device appears as a single
device easier to handle) twochannels can be retrieved but both
show a sample rate value of 0!
Is this behaviour a bug ?
No. From <CoreAudio/CoreAudioTypes.h>
/*!
@enum AudioStreamBasicDescription Constants
@abstract Constants for use with AudioStreamBasicDescription
@constant kAudioStreamAnyRate
The format can use any sample rate. Note
that this constant can only appear
in listings of supported formats. It will
never appear in a current format.
*/
enum
{
kAudioStreamAnyRate = 0
};
I see that HALCode is using the
kAudioDevicePropertyAvailableNominalSampleRates property to get the
sample rate values.
Is this the recommended way of doing?
If all you need to know is the available selection of sample rates,
then use this property. Indeed, one of the reasons it is available is
to disambiguate kAudioStreamAnyRate.
If you want to know more precisely what sample rates go with which
stream formats on each stream, use the New-In-Tiger property,
kAudioStreamPropertyAvailableVirtualFormats, which supersedes
kAudioDevicePropertyStreamFormats.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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