Re: Stereo Processing
Re: Stereo Processing
- Subject: Re: Stereo Processing
- From: paul Fultz <email@hidden>
- Date: Sun, 18 Mar 2007 18:39:17 -0700 (PDT)
ok thanks for the information, so if i overide AUBase
instead all I would need to do is overide Render() and
Reset(), right? and how would i go about coding the
Render() so that i can call Process()? i was working
on some of the code here i dont know if this is
correct, i kind of just compiled it together from
looking at other code:
ComponentResult AUStereoBase::Render(
AudioUnitRenderActionFlags & ioActionFlags,
const AudioTimeStamp & inTimeStamp,
UInt32 inNumberFrames)
{
bool ioSilence = IsInputSilent (ioActionFlags,
inFramesToProcess);
ioActionFlags |=
kAudioUnitRenderAction_OutputIsSilence;
AUInputElement *input = GetInput(0);
AUOutputElement *output = GetOutput(0);
AudioUnitRenderActionFlags xflags = 0;
ComponentResult result = PullInput(0, xflags,
inTimeStamp, inFramesToProcess);
if (result) return result;
Float32 *sourceLeftP = input->GetChannelData(0);
Float32 *sourceRightP = input->GetChannelData(1);
Float32 *destLeftP = output->GetChannelData(0);
Float32 *destRightP = output->GetChannelData(1);
Process(sourceLeftP,
sourceRightP,destLeftP,destRightP,
inNumberFrames,ioSilence);
return noErr;
}
also Process() is a virtual funcion in the class
AUStereroBase, which i will overide in my AU class.
also how can read number of channels in? i want do
something different if the input is mono, like call
Process() in this way:
Process(sourceLeftP, sourceLeftP,destLeftP,destRightP,
inNumberFrames,ioSilence);
thanks,
Paul
--- William Stewart <email@hidden> wrote:
> We generally overide AUBase and just implement the
> Render method -
> then instead of working around all this stuff, you
> just implement
> what you need. I think its clearer and easier (but
> many have ignored
> me in the past!)
>
> Bill
>
> On 16/03/2007, at 6:47 AM, Christian Luther wrote:
>
> > Hi Paul!
> >
> > Unfortunately there is more work to do. You also
> have to modify the
> > function that creates the kernels
> (MaintainKernels()) so that you
> > have your stereo kernel set up correctly (it
> usually creates one
> > kernel per I/O which is not what you want). If you
> want to support
> > stereo processing only you can just create one
> instance of your
> > Stereokernel. If you want to support both mono and
> stereo
> > processing you will have to do some more work
> there.
> > Then, you have to modify ProcessBufferLists()
> which is the function
> > that finally calls the Process() functions of the
> kernels.
> >
> > I can't really remember the details, but just look
> around the
> > methods I named and try to understand what they
> do. Then it
> > shouldn't be a problem to modify everything
> accordingly. Hey, even
> > I got it to work! ;)
> >
> > Greets,
> > Christian
> >
> > Am 16.03.2007 um 00:01 schrieb paul Fultz:
> >
> >> ok thanks, well couldnt i create two classes like
> myAUEffectBase
> >> and myAUKernelBase, and have them inherit
> AUEffectBase and
> >> AUKernalBase respectively and just overide
> ProcessBufferList() to
> >> use myAUKernelBase, which will have an additional
> function called
> >> ProcessStereo() or would i need to overide other
> functions as
> >> well? also, where do i set the audio unit to only
> recieve mono or
> >> stereo, and set the output to only stereo?
> >>
> >> thanks,
> >> paul
> >>
> >> William Stewart <email@hidden> wrote:
> essentially yes (that's a
> >> short version - there is a long version but it
> would require
> >> refactoring much of the code of AUEffectBase and
> its kernel
> >> objects that is probably too lengthy to go into
> here I think).�
> >>
> >> Bill
> >>
> >> On 12/03/2007, at 1:52 PM, paul Fultz wrote:
> >>
> >>> I would like to set up my audio unit to process
> stereo, is there
> >>> someway i can set it up so that it will call a
> funtion like this
> >>> in my class to do the processing:
> >>> void ��� ��� ��� ���
> Process(���
> >>> const Float32 * ��� inSourceLeft, // left
> input
> >>> ��� �� �� �� �� ��
> �� �� ��
> >>> �� �� �� �� const Float32 *
> ���
> >>> inSourceRight, //right input
> >>> ��� ��� ��� ���
> ��� ���
> >>> ��� ��� ��� ���
> ��� Float32 *
> >>> ��� ��� ��� inDestLeft, //left
> output
> >>> ��� ��� ��� ���
> ��� ���
> >>> ��� ��� ��� ���
> ��� Float32 *
> >>> ��� ��� ��� inDestRight,
> //right output
> >>> ��� ��� ��� ���
> ��� ���
> >>> ��� ��� ��� ���
> ��� UInt32
> >>> ��� ��� ��� ���
> inFramesToProcess,
> >>> ��� ��� ��� ���
> ��� ���
> >>> ��� ��� ��� ���
> ��� bool &���
> >>> ��� ��� ��� ioSilence)
> >>>
> >>> i am inherenting AUKernelBase, and
> AUEffectsBase, can i just
> >>> override ProcessBufferList() in my class? and if
> so how would i
> >>> write the code to call this function that is
> located in my kernel
> >>> (e.g. class myAudioUnitKernel : public
> AUKernelBase)?
> >>>
> >>> No need to miss a message. Get email on-the-go
> >>> with Yahoo! Mail for Mobile. Get started.
> >>>
> �_______________________________________________
> >>> Do not post admin requests to the list. They
> will be ignored.
> >>> Coreaudio-api mailing list� � �
> (Coreaudio-
> >>> 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
> >>
>
_____________________________________________________________________
>
> >> _____
> >>
> >>
> >>
> >> 8:00? 8:25? 8:40? Find a flick in no time
> >> with theYahoo! Search movie showtime shortcut.
> >> _______________________________________________
> >> Do not post admin requests to the list. They will
> be ignored.
> >> Coreaudio-api mailing list
> (email@hidden)
> >> Help/Unsubscribe/Update your Subscription:
> >>
>
>
> >> email@hidden
> >>
> >> This email sent to email@hidden
> >
> > _______________________________________________
> > 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
>
> --
> 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
>
________________________________________________________________________
>
>
=== message truncated ===
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/
_______________________________________________
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