Re: AU Host Sample?
Re: AU Host Sample?
- Subject: Re: AU Host Sample?
- From: Urs Heckmann <email@hidden>
- Date: Sat, 22 May 2004 00:15:02 +0200
There are AU hosting examples in the SDK...
Developer/Examples/CoreAudio/Services/
It depends on what you want to do though. It's a bit more complex when
you don't use AUGraphs. In that case you have to update the TimeStamp
(important!), send raw MidiEvents, install Input Callback, send Render
calls (better: use FastDispatch Callbacks).
For convenience, there are a lot of neat utilities in PublicUtility
now, i.e. CAAudioUnit, CAComponent etc.
Basically (uhm, very basic):
Setup process:
- Find a Component (needs ComponentType, SubType, ManufacturerID )
- Open the Component
- SetProperty kAudioUnitProperty_SetRenderCallback
- SetProperty kAudioUnitProperty_StreamFormat on kAudioUnitScope_Input
and kAudioUnitScope_Output
- Initialize Audio Unit
Render Process:
- reset AU
<loop>
- send events, i.e. MusicDeviceMIDIEvent();
- Call Render (AU calls your InputCallback), increasing the host Time
TimeStamp each call
</loop>
Open GUI:
Create a WindowRef
Get ComponentDescription for AUViewComponent
OpenAComponent
AudioUnitCarbonViewCreate
Adjust window size
This should be 50-100 lines of code. (I've done this in a VST and an AU
that hosts another AU)
Then, to refine everything, grab parameter list, preset list, install
property listeners, get/set ClassInfo etc, and tie that to your host
application's logic.
Hope this helps for a start...
Cheers,
;) Urs
Am 21.05.2004 um 21:49 schrieb m:
Hope this is the right place...I'm trying to get started on writing an
app that needs to host AUs. The sample code I've found so far
(synthtest <http://www.manyetas.com/creed/synthtest.html>) doesn't
compile, and the compiled version crashes, so tha's an inauspicious
start.
The docs, while they seem thorough and acurate, merely recount facts,
and don't really outline what you need to do (I'm thinking of the
"Tasks" section that much of Apple's docs have).
Any pointers?
Thanks in advance!
_murat
_______________________________________________
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.