Re: Audio Unit hosting requires c++?
Re: Audio Unit hosting requires c++?
- Subject: Re: Audio Unit hosting requires c++?
- From: patrick machielse <email@hidden>
- Date: Thu, 14 Jun 2007 21:36:25 +0200
Op 14-jun-2007, om 20:06 heeft Kurt Revis het volgende geschreven:
I added the last two lines to playFile() in auplayer.c, and it
started working:
ComponentDescription description;
description.componentType = kAudioUnitType_Generator;
description.componentSubType = kAudioUnitSubType_AudioFilePlayer;
description.componentManufacturer = kAudioUnitManufacturer_Apple;
+ description.componentFlags = 0;
+ description.componentFlagsMask = 0;
Does that work for you?
It did! It would have taken me days, if not weeks to find that. Thanks!
I did notice that sometimes the code would suddenly work an play a
file, so that also seems to support the 'garbage' value theory. This
was one of the few pieces of code from the PlayFile example code that
I actually did use... The example program seems to get away with it.
I don't understand how that could have possibly caused the
NewAUGraph() call to fail, though! Something subtle about
uninitialized variables, I guess.
In hindsight it does make sense, I think. Initially I expected this
code to fail if no unit could be matched with the description:
if ( error = AUGraphNewNode(graph, &description, 0, NULL, &fileNode) ) {
printf("AUAudioFilePlayer not found (%d)\n", error);
return;
}
I think the fact that componentFlags and componentFlagsMask must be 0
here means that the actual Audio Unit / Component lookup is delayed
until the call to AUGraphOpen() (the documentation doesn't seem to
say when the actual lookup is performed). My error message is wrong
here too; no search is taking place.
I'm getting there, I'm just getting there slooooowly ;-)
Thanks again for your help,
Patrick Machielse
--
Hieper Software
_______________________________________________
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