Re: RemoteIO vs AUGraphAddNode on iOS
Re: RemoteIO vs AUGraphAddNode on iOS
- Subject: Re: RemoteIO vs AUGraphAddNode on iOS
- From: Patrick Shirkey <email@hidden>
- Date: Mon, 14 Nov 2011 02:30:52 +0100 (CET)
- Importance: Normal
> First stop is to read the manual:
> http://developer.apple.com/library/ios/#DOCUMENTATION/MusicAudio/Conceptual/AudioUnitHostingGuide_iOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009492-CH1-SW1
>
> If you want to do audio processing you can attach a render callback to an
> AudioUnit in a graph. For example if you wanted to read audio from a file
> and apply an effect then output it your graph could look something like
> this
>
> AUFilePlayer -> RemoteIO
>
> But instead of directly connecting the units you could add a render
> callback method to the RemoteIO that would get called every time
> the RemoteIO needed samples. In this render callback you would ask the
> file
> player for samples and then apply your processing. Something similar to
> http://pastie.org/2859464 if that callback was attached to the RemoteIO
> unit.
>
> Anyway that link at the top will help.
>
Thanks, that second snippet is quite useful too :-)
The graph I am currently attempting is :
file -> (4 chan) mixer -> (stereo) fx (RIO) -> (stereo) eq -> (stereo)
output (RIO)
When I add in the fx node it just falls over without error but the code
without the fx node works fine :
file -> (4 chan) mixer -> (stereo) eq -> (stereo) rio (output)
Is that first chain the correct way to setup the graph? Do I need an rio
"out" and rio "in" ex:
file -> (4 chan) mixer -> (stereo) fx in (RIO) -> (stereo) fx out
(RIO)-> (stereo) eq -> (stereo) output (RIO)
or does the rio node handle both in and out?
Am I just missing the point of the callback? Readily admit that callbacks
are not my strong suit...
--
Patrick Shirkey
Boost Hardware Ltd
> Aran
>
>
>
>
> On Mon, Nov 14, 2011 at 12:00 PM, Patrick Shirkey <
> email@hidden> wrote:
>
>>
>> > are you trying to create two remoteIO nodes in the same graph? The
>> call
>> > here
>> >
>> > // delay unit
>> > CAComponentDescription delay_desc(kAudioUnitType_Output,
>> > kAudioUnitSubType_RemoteIO, kAudioUnitManufacturer_Apple);
>> >
>> > has kAudioUnitType_Output as the type and kAudioUnitSubType_RemoteIO
>> > as the sub type. Is that what you want?
>> >
>> > What is the problem? why doesn't it "work"?
>> >
>>
>> I tried upgrading to iOS 5 in case it was just a bug but it appears to
>> be
>> either a feature or I am completely wrong about how the RIO interface is
>> supposed to work.
>>
>> From the other code I have seen for example the bioaudio example it
>> should
>> be fine to use two rio nodes in one graph. Is that a correct assumption
>> to
>> make with coreaudio in general and maybe this is just an ios issue or am
>> I
>> completely wrong in that assumption?
>>
>>
>> --
>> Patrick Shirkey
>> Boost Hardware Ltd
>>
>>
>>
>>
>> > On Thu, Nov 10, 2011 at 3:24 PM, Patrick Shirkey
>> > <email@hidden> wrote:
>> >> Hi,
>> >>
>> >> I asked Apple Developer Support and they [c/w]ouldn't provide an
>> answer
>> >> for me
>> >>
>> >> Can anyone tell me why this code works:
>> >>
>> >> ----------
>> >>
>> >> AUNode outputNode;
>> >>
>> >> // create a new AUGraph
>> >> result = NewAUGraph(&mGraph);
>> >> if (result) { printf("NewAUGraph result %ld X %4.4s\n", result,
>> >> (unsigned int)result, (char*)&result); return; }
>> >>
>> >> // output unit
>> >> CAComponentDescription output_desc(kAudioUnitType_Output,
>> >> kAudioUnitSubType_RemoteIO, kAudioUnitManufacturer_Apple);
>> >>
>> >> result = AUGraphAddNode(mGraph, &output_desc, &outputNode);
>> >> if (result) { printf("AUGraphNewNode 1 result %lu %4.4s\n",
>> >> result,
>> >> (char*)&result); return; }
>> >>
>> >>
>> >> -----------
>> >>
>> >> But this code doesn't:
>> >>
>> >> -----------
>> >>
>> >> AUNode outputNode;
>> >> AUNode delayNode;
>> >>
>> >> // create a new AUGraph
>> >> result = NewAUGraph(&mGraph);
>> >> if (result) { printf("NewAUGraph result %ld X %4.4s\n", result,
>> >> (unsigned int)result, (char*)&result); return; }
>> >>
>> >> // output unit
>> >> CAComponentDescription output_desc(kAudioUnitType_Output,
>> >> kAudioUnitSubType_RemoteIO, kAudioUnitManufacturer_Apple);
>> >>
>> >> // delay unit
>> >> CAComponentDescription delay_desc(kAudioUnitType_Output,
>> >> kAudioUnitSubType_RemoteIO, kAudioUnitManufacturer_Apple);
>> >>
>> >> result = AUGraphAddNode(mGraph, &output_desc, &outputNode);
>> >> if (result) { printf("AUGraphNewNode 1 result %lu %4.4s\n",
>> >> result,
>> >> (char*)&result); return; }
>> >>
>> >> result = AUGraphAddNode(mGraph, &delay_desc, &delayNode);
>> >> if (result) { printf("AUGraphNewNode 2 result %lu %4.4s\n",
>> >> result,
>> >> (char*)&result); return; }
>> >>
>> >> ---------
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Patrick Shirkey
>> >> Boost Hardware Ltd
>> >> _______________________________________________
>> >> 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
>> >>
>> >
>>
>>
>> --
>> Patrick Shirkey
>> Boost Hardware Ltd
>>
>
--
Patrick Shirkey
Boost Hardware Ltd
_______________________________________________
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