Re: default audio output device
Re: default audio output device
- Subject: Re: default audio output device
- From: Kurt Bigler <email@hidden>
- Date: Sat, 21 Dec 2002 15:46:02 -0800
on 12/21/02 1:52 AM, Jirtme Duquennoy <email@hidden> wrote:
>
Hello
>
>
I try to use the default audio output device. The problem I encounter
>
is that the audio unit I get this way is a V1 audio unit ... This
>
kind of audio unit only have one buffer containing both channels ...
>
I would really prefer to have one buffer per channel. I have read
>
that this is the way audio units V2 works. Is it possible to get a V2
>
default output audio unit ..
Instead of using the convenient shortcut (now deprecated, I believe) which
works only for the V1 unit:
err = OpenDefaultAudioOutput (&theOutputUnit);
you must instead use the component manager routines. This gives you full
flexibility to chose V1 vs V2, and also default vs other audio units. The
following snippet illustrates how either the V1 or V2 default output unit
could be opened by this method:
ComponentDescription searchDesc;
if (useV2)
{
searchDesc.componentType = kAudioUnitType_Output;
searchDesc.componentSubType = kAudioUnitSubType_DefaultOutput;
searchDesc.componentManufacturer = 0;
}
else // V1
{
searchDesc.componentType = kAudioUnitComponentType;
searchDesc.componentSubType = kAudioUnitSubType_Output;
searchDesc.componentManufacturer = kAudioUnitID_DefaultOutput;
}
searchDesc.componentFlags = 0;
searchDesc.componentFlagsMask = 0;
Component theAUComponent = FindNextComponent (NULL, &searchDesc);
if (theAUComponent == NULL)
err = fnfErr;
else
err = OpenAComponent (theAUComponent, &theOutputUnit);
I massaged code I had around to create the above example, but did not test
it, so apologies for any typos.
In any case the above illustrates the change in Apple's scheme for
identifying audio units between V1 and V2. You can find doc for all this
online on developer.apple.com, and the doc is hopefully more meaningful with
an example to get you started.
-Kurt Bigler
>
Thank you for your attention
>
>
Jerome Duquennoy
>
_______________________________________________
>
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.