Linking together audio units
Linking together audio units
- Subject: Linking together audio units
- From: Brian Barnes <email@hidden>
- Date: Tue, 2 Oct 2001 01:17:39 -0400
Bill, Chris ... anybody else with @apple (!!!) ...
My questions are becoming more intelligent, I'm starting to feel my way
into this. Now I want to link audio units together. Say, I want to add
an effect to a sample playing.
So far, this is what I think (by the docs) should be the setup. I have
3 audio units.
Audio Unit A
------------------
type: kAudioUnitComponentType
subtype: kAudioUnitSubType_Output
opened by:
OpenDefaultComponent(kAudioUnitComponentType,kAudioUnitSubType_Output);
Audio Unit B
------------------
type: kAudioUnitComponentType
subtype: kAudioUnitSubType_Effect
opened by:
compdesc.componentType=kAudioUnitComponentType;
compdesc.componentSubType=kAudioUnitSubType_Effect;
compdesc.componentManufacturer=kAudioUnitID_MatrixReverb;
compdesc.componentFlags=0;
compdesc.componentFlagsMask=0;
compid=FindNextComponent(NULL,&compdesc);
au=(AudioUnit)OpenComponent(compid);
Audio Unit C
------------------
type: kAudioUnitComponentType
subtype: kAudioUnitSubType_Output
opened by:
OpenDefaultComponent(kAudioUnitComponentType,kAudioUnitSubType_Output);
I hookup input to A by setting the property
kAudioUnitProperty_SetInputCallback. If I leave it at that, it works
fine, and plays the sample.
Next, I kAudioUnitProperty_MakeConnection to hookup the input of Unit B
from Unit A.
Then another kAudioUnitProperty_MakeConnection to hookup the input of
Unit C from Unit B.
I'm not sure what sourceOutputNumber and destInputNumber are, so I set
them to zero. I have a single input/output, so I'm guessing this will
be OK.
I call AudioOutputUnitStart on both A and C, and I get a sample that
plays twice as fast!
So what am I doing wrong here?
[>] Brian