RE: AURenderCallback inputs...
RE: AURenderCallback inputs...
- Subject: RE: AURenderCallback inputs...
- From: "Amir Aharon" <email@hidden>
- Date: Sun, 14 Aug 2005 21:01:17 +0200
- Importance: Normal
Thanks Bill,
However I still cann't make the render callback to work.
Here is what I did( hope you have the patience)
ComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_HALOutput;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
desc.componentFlags = 0;
desc.componentFlagsMask = 0;
ComponentDescription effectDesc;
effectDesc.componentType = kAudioUnitType_Effect;
effectDesc.componentSubType = kAudioUnitSubType_Delay;
effectDesc.componentManufacturer = kAudioUnitManufacturer_Apple;
effectDesc.componentFlags = 0;
effectDesc.componentFlagsMask = 0;
err = NewAUGraph(&mGraph);
err = AUGraphNewNode(mGraph, &desc, 0, NULL, &mIONode);
err = AUGraphNewNode(mGraph, &effectDesc, 0, NULL, &mEffectNode);
err = AUGraphConnectNodeInput( mGraph, mIONode, 1, mEffectNode, 0);
err = AUGraphConnectNodeInput( mGraph, mEffectNode, 0, mIONode, 0);
err = AUGraphOpen(mGraph);
err = AUGraphGetNodeInfo(mGraph, mIONode, NULL, NULL, NULL, &mHALUnit
);
err = AUGraphGetNodeInfo(mGraph, mEffectNode, NULL, NULL, NULL,
&mEffectUnit );
enableIO = 1;
err = AudioUnitSetProperty(mHALUnit, kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Input, 1, &enableIO,sizeof(enableIO));
enableIO = 1;
err = AudioUnitSetProperty(mHALUnit, kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Output, 0, &enableIO, sizeof(enableIO));
AURenderCallbackStruct renderCB;
memset(&renderCB, 0, sizeof(AURenderCallbackStruct));
renderCB.inputProcRefCon = NULL;
renderCB.inputProc = MyRenderProc;
err = AudioUnitSetProperty(mEffectUnit,
kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0,
&renderCB, sizeof(AURenderCallbackStruct));
err = AUGraphInitialize(mGraph);
err = AUGraphStart (mGraph);
OSStatus MyRenderProc(void *inRefCon, AudioUnitRenderActionFlags
*inActionFlags, const AudioTimeStamp *inTimeStamp, UInt32
inBusNumber,UInt32 inNumFrames, AudioBufferList *ioData)
{
OSStatus err = noErr;
err = AudioUnitRender(mHALUnit, inActionFlags, inTimeStamp,
inBusNumber, inNumFrames, mInputBuffer);// my allocated InputBuffer
MyProcess(mInputBuffer);
Copy_InputBuffer_Into_IOData(mInputBuffer, ioData);
return err;
}
I can hear the sound processed with the delay effect however
MyRenderProc doesn't gets called?
Any Idea?
Amir.
-----------------------------------
Amir Aharon
Software Developer
Waves Ltd.
> -----Original Message-----
> From: William Stewart [mailto:email@hidden]
> Sent: Thursday, August 11, 2005 9:06 PM
> To: Amir Aharon
> Cc: email@hidden
> Subject: Re: AURenderCallback inputs...
>
>
> You can't do it this way.
>
> What you could do is have your render callback attached to
> the effect
> node. Then in your render callback, you call the AUHAL's Render call
> on bus 1, get the audio input, do you processing, etc, then return
> from the callback.
>
> Bill
>
> On 10/08/2005, at 11:42 PM, Amir Aharon wrote:
>
> > My renderer call back is attached to the processing Node.
> > I'm trying to "trap" the buffer stream in the processing node and
> > apply
> > my process efect on it.
> >
> > Amir.
> >
> >
> > -----------------------------------
> > Amir Aharon
> > Software Developer
> > Waves Ltd.
> >
> >
> >> -----Original Message-----
> >> From: William Stewart [mailto:email@hidden]
> >> Sent: Wednesday, August 10, 2005 8:38 PM
> >> To: Amir Aharon
> >> Cc: email@hidden
> >> Subject: Re: AURenderCallback inputs...
> >>
> >>
> >>
> >> An AU's input can be one of two types:
> >> (1) An input callback - so it gets input by calling a
> render callback
> >> function
> >> (2) A connection to another AU - so it gets its input calling
> >> AudioUnitRender on the connected AU
> >>
> >> So, given this topology:
> >> AUHAL Input -> processing node -> AUHAL Output
> >>
> >> what is it that you are trying to achieve with your render
> callback -
> >> and where is it attached too?
> >>
> >> Bill
> >>
> >> On 10/08/2005, at 8:38 AM, Amir Aharon wrote:
> >>
> >>
> >>> Hi,
> >>> I have created an AUGraph with two node , first is the
> >>>
> >> ioNode which is
> >>
> >>> my io device and second which is my audioNode for processing.
> >>>
> >>> I would like to connect the input device into the AudioUnit
> >>>
> >> , do some
> >>
> >>> processing and send it into the device output.
> >>>
> >>> Accourding to the API( I Hope) , all I need to do is to
> connect the
> >>> ioNode bus 1 into audioNode bus 0 and audioNode bus 0 into ioNode
> >>> bus 0. ( I use the same Audio device as input and output).
> >>>
> >>> I'm tring to set the AURenderCallback(... AudioBufferList
> >>> *ioData...) of
> >>> the audioNode and my question is:
> >>> Does the ioData parameter is input/output? meaning Does it
> >>>
> >> contain the
> >>
> >>> sound buffer which I can process apon?
> >>> Or does ioData is empty and I should fill it with sound?
> >>>
> >>> Thanks,
> >>> Amir.
> >>>
> >>> -----------------------------------
> >>> Amir Aharon
> >>> Software Developer
> >>> Waves Ltd.
> >>>
> >>> _______________________________________________
> >>> Do not post admin requests to the list. They will be ignored.
> >>> Coreaudio-api mailing list (email@hidden)
> >>> Help/Unsubscribe/Update your Subscription:
> >>>
> >>>
> >>
> > 40apple.com
> >
> >>>
> >>> This email sent to email@hidden
> >>>
> >>>
> >>
> >> --
> >> mailto:email@hidden
> >> tel: +1 408 974 4056
> >> ______________________________________________________________
> >> __________
> >> __
> >> "Much human ingenuity has gone into finding the ultimate
> >> Before. The current state of knowledge can be summarized
> >> thus: In the beginning, there was nothing, which exploded" -
> >> Terry Pratchett
> >> ______________________________________________________________
> >> __________
> >> __
> >>
> >>
> >
> >
>
> --
> mailto:email@hidden
> tel: +1 408 974 4056
> ______________________________________________________________
> __________
> __
> "Much human ingenuity has gone into finding the ultimate
> Before. The current state of knowledge can be summarized
> thus: In the beginning, there was nothing, which exploded" -
> Terry Pratchett
> ______________________________________________________________
> __________
> __
>
_______________________________________________
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