Getting available sample rate
Getting available sample rate
- Subject: Getting available sample rate
- From: Stéphane Letz <email@hidden>
- Date: Thu, 27 Nov 2008 12:30:56 +0100
Hi,
In our program, we are using the following code to retrieve the list
of available sample rate for a given device:
// Sampling rate
err = AudioDeviceGetPropertyInfo(selDevID, 0, false,
kAudioDevicePropertyAvailableNominalSampleRates, &size, &isWritable);
if (err != noErr) {
NSLog(@"err in (info)
kAudioDevicePropertyAvailableNominalSampleRates");
}
int count = size / sizeof(AudioValueRange);
JPLog("Sample rate different values: %ld\n",count);
AudioValueRange valueTable[count];
err = AudioDeviceGetProperty(selDevID, 0, false,
kAudioDevicePropertyAvailableNominalSampleRates, &size, valueTable);
if (err != noErr) {
NSLog(@"err in (info)
kAudioDevicePropertyAvailableNominalSampleRates");
}
for (i = 0; i < count; i++) {
JPLog("Sample rate value: %ld\n",(long)valueTable[i].mMinimum);
[samplerateText addItemWithTitle:[[NSNumber numberWithLong:
(long)valueTable[i].mMinimum] stringValue]];
}
But it appears that will some devices like Echo Gina, this code only
sees 6 possible values (8000, 11025, 16000, 22050, 32000, 64000) where
10 are available (8000, 11025, 16000, 22050, 32000, 44100, 48000,
64000, 88200, 96000) as seen by Audio Midi Setup for example.
Could it be:
1) that we always use the AudioDeviceGetProperty call using the
"isInput" parameter to false, event for input only device?
2) that we read the mMinimum field of AudioValueRange? (where 2 fields
mMinimum and mMaximum are available ?
3) any other reason?
Thanks
Stephane Letz
_______________________________________________
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