Re: "afrecord" example in the /CoreAudio/Services/AudioFileTools folder (again)
Re: "afrecord" example in the /CoreAudio/Services/AudioFileTools folder (again)
- Subject: Re: "afrecord" example in the /CoreAudio/Services/AudioFileTools folder (again)
- From: "Roni Music" <email@hidden>
- Date: Mon, 11 Oct 2004 19:48:49 +0200
----- Original Message -----
From: "Doug Wyatt" <email@hidden>
To: "Rolf Nilsson" <email@hidden>
Cc: <email@hidden>
Sent: Monday, October 11, 2004 7:18 PM
Subject: Re: "afrecord" example in the /CoreAudio/Services/AudioFileTools folder (again)
> On Oct 7, 2004, at 12:50, Rolf Nilsson wrote:
> > UInt32 enableIO = 0;
> > XThrowIfError(AudioUnitSetProperty(mInputUnit,
> > kAudioOutputUnitProperty_EnableIO,
> > kAudioUnitScope_Output,
> > 0, //AudioUnitElement
> > &enableIO,
> > sizeof(enableIO)), "failed to disable output");
> >
> > The code fails here with an error of -10879
> > (kAudioUnitErr_InvalidProperty)
> > when using an USB device called MD-Port DG2 (a device use to record to
> > Mini Discs, should be compatible with OS X)
> >
> > Does this mean the driver is badly written or written for an earlier
> > version of CoreAudio or some other problem.
> >
> > No one else has ever reported this problem so it's no big deal but it
> > would be nice to know.
> >
> > Thanks
> > Rolf Nilsson
>
> That error is returned when you try to set the EnableIO property on the
> default output unit (as opposed to AUHAL).
Strange because the code is directly from your TN2091
Component comp;
ComponentDescription desc;
//There are several different types of Audio Units.
//Some audio units serve as Outputs, Mixers, or DSP
//units. See AUComponent.h for listing
desc.componentType = kAudioUnitType_Output;
//Every Component has a subType, which will give a clearer picture
//of what this components function will be.
desc.componentSubType = kAudioUnitSubType_HALOutput;
//all Audio Units in AUComponent.h must use
//"kAudioUnitManufacturer_Apple" as the Manufacturer
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
//Finds a component that meets the desc spec's
comp = FindNextComponent(NULL, &desc);
if (comp == NULL) exit (-1);
//gains access to the services provided by the component
OpenAComponent(comp, &InputUnit);
UInt32 enableIO;
UInt32 size=0;
//When using AudioUnitSetProperty the 4th parameter in the method
//refer to an AudioUnitElement. When using an AudioOutputUnit
//the input element will be '1' and the output element will be '0'.
enableIO = 1;
AudioUnitSetProperty(InputUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Input,
1, // input element
&enableIO,
sizeof(enableIO));
// this one fails with an error of -10879 (kAudioUnitErr_InvalidProperty)
enableIO = 0;
AudioUnitSetProperty(InputUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Output,
0, //output element
&enableIO,
sizeof(enableIO));
It happens on a G4/400 with OSX 10.2.8
not mine, I can't dupplicate it on my machines and no one except this guy have reported the problem.
could it be a problem with that particular machine?
thanks
Rolf
>
> Doug
>
_______________________________________________
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