Re: Setting Input Sample Format and Rate
Re: Setting Input Sample Format and Rate
- Subject: Re: Setting Input Sample Format and Rate
- From: Doug Zwick <email@hidden>
- Date: Thu, 14 Sep 2006 15:55:01 -0600
On 14-Sep-06, at 1:48 PM, Doug Wyatt wrote:
On Sep 14, 2006, at 10:38 , Doug Zwick wrote:
I think you missed the gist of my question: I'm not looking for
rate conversion here, I'm looking to set the input device to
record at a device-supported sample rate. I am testing with two
audio devices: a USB mic (supports input at 8000, 11025, 22050,
44100 and 48000 Hz according to Audio MIDI Setup and HALLab), and
an iSight (48000 Hz only). I would expect that trying to set a
sample rate of 8000 Hz in the set property call for SampleFormat
would work properly for the USB mic (as the device supports that
rate), but return an error code for the iSight. I always get a
zero error code back from the set property call, and it fails in
both cases when AudioUnitRender is called. Is setting the
mSampleRate field of the kAudioUnitProperty_StreamFormat property
the correct way to select a supported device sample rate that is
not set as the current nominal sample rate?
No.
If you set it on the client side of AUHAL's converter (input scope/
element 0 or output scope/element 1) you're changing the format
that you're sending/receiving to AUHAL.
If you set it on the device side (input scope/element 1 or output
scope/element 0), you get an error.
To change a device's sample rate, use the HAL APIs.
So when I change the rate in the audio unit's SampleFormat property,
I'm changing how AUHAL talks to its converter, and the mismatch
doesn't become apparent (and might not even exist) until I call
AudioUnitRender in the input callback. That explains a great deal.
Thanks.
_______________________________________________
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