Re: Sampling Rate Support
Re: Sampling Rate Support
- Subject: Re: Sampling Rate Support
- From: Shaun Wexler <email@hidden>
- Date: Sat, 26 Apr 2003 02:32:46 -0700
On Friday, April 25, 2003, at 05:07 PM, BlazeAudio Developer wrote:
It seems like a lot of applications (including the Daisy sample) do not
look at the range.
I have now added some discrete rates as well as the range to the stream
formats.
Thanks.
Devendra.
Let's remember that neither Apple nor its products are guaranteed to
(necessarily) implement the technology they themselves create and
proscribe; Cocoa doesn't strictly follow its own Human Interface
Guidelines, and not one of Apple's major software apps even seems to
try! ;)
My recommendation is to "do it right" yourself, and file a bug against
Audio MIDI Setup, Daisy, etc. If the app only reads the low member of
the AudioValueRange struct, that's not "correct" behavior, as you've
seen. A range is defined as { min, max }, in this case.
From the CoreAudio Framework headers:
// This structure holds a pair of numbers representing a continuous
range of values
struct AudioValueRange
{
Float64 mMinimum;
Float64 mMaximum;
};
typedef struct AudioValueRange AudioValueRange;
kAudioDevicePropertyAvailableNominalSampleRates = 'nsr#',
// An array of AudioValueRange inidicating the valid ranges for the
// nominal sample rate of the device.
Something else to try might be to create ranges like this:
{ 4990, 8000 },
{ 8000, 11025 },
{ 11025, 12000 },
{ 12000, 16000 },
{ 16000, 22050 },
{ 22050, 24000 },
{ 24000, 32000 },
{ 32000, 44100 },
{ 44100, 48000 },
{ 48000, 55000 }
... so that any applications which don't read the ranges properly may
still be able to use the values your driver is providing. I admit that
I only watch for property notifications on the nominal rate(s) of the
devices themselves, and don't check the individual stream formats to
see if they match the device rate. By definition, each client device
should have the same sample rate for all its streams, correct?
// Audio Streams are the gate keepers of format information. Each Audio
Stream
// on an Audio Device may have it's own format. Further, changes to the
format
// of one Audio Stream can and often do affect the format of the other
Audio Streams
// on the Audio Device. This is particularly true of the sample rate
aspect of the
// stream's format, as all streams attached to a device share the same
sample rate.
We should also be utilizing kAudioDevicePropertyIOProcStreamUsage, but
most ignore that facility, as well... ;)
--
Shaun Wexler
MacFOH
http://www.macfoh.com
At 06:37 PM 4/23/2003, Jeff Moore wrote:
You are reporting the fact that your hardware does a continuous range
correctly. It's just that most apps don't really care about the
sample rate of the hardware. They will just use whatever is set when
they launch and do rate conversion to get their data into the right
sample rate. Apps that do care, tend to care only about the commonly
used sample rates, like 44100, 48000, 96000, etc.
At any rate, the HAL reports the continuous range via
kAudioDevicePropertyAvailableNominalSampleRates since the
AudioStreamBasicDescriptions provided through
kAudioDevicePropertyStreamFormats or
kAudioStreamPropertyPhysicalFormats will report the rate as
kAudioStreamAnyRate.
On Wednesday, April 23, 2003, at 05:10 PM, BlazeAudio Developer
wrote:
Does a driver need to specify "discreet" sampling rates even when
the
hardware can support a range of sampling rates?
We have a device which can support a range of sampling rates, and
so we
call addAvailableFormat() with the minimum and maximum rates.
However, some applications do not seem to "realize" this and
claim that
the device does not support anything except 44.1K!
Thanks.
Devendra.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.