Re: Setting Formats...
Re: Setting Formats...
- Subject: Re: Setting Formats...
- From: Jeff Moore <email@hidden>
- Date: Thu, 17 Jan 2002 12:31:15 -0800
on 1/17/02 11:09 AM, Jim Dolan <email@hidden> wrote:
>
I am running into an error and I don't know why...
>
>
>
I have code which sets the Actual and Physical Formats of my device for each
>
stream. I set these formats using the AudioStreamSetProperty. I dynamically
>
get the stream ID using the kAudioDevicePropertyStreams property.
>
>
The code first sets the Physical Format then sets the Actual Format in the
>
same manner... Every few times that I run this code I get a bogus streamID
>
value when setting the Actual Format. When I call
>
AudioDeviceGetPropertyInfo( ... kAudioDevicePropertyStreams ..., &outSize...
>
)
>
the outsize is 0 - thus I get no stream ID, so of course I fail shortly
>
after. I also notice that the stream ID changes quite often, is this what
>
is causing me to fail?
>
>
Do I have to wait after setting the Physical Format so the stream ID's can
>
settle down before trying to set the Actual Format...
First, you don't have to set both the physical and actual formats. Doing so,
doesn't necessarily hurt you, but it is a waste of time.
Second, setting the format of the device, like the setting of all
properties, is asynchronous. When it completes, you will get the appropriate
notifications on your listener procs.
--
Jeff Moore
Core Audio
Apple