3
votes

Recently, I was watching aurioTouch. But I can't understand this sentence:

OSStatus err = AudioUnitRender (THIS-> rioUnit, ioActionFlags, inTimeStamp, 1, inNumberFrames, ioData); 

According to apple documentaion explains:Initiates a rendering cycle for an audio unit. But I feel are ambiguous.What is it to do?

1

1 Answers

6
votes

Core Audio works on a "pull" model, where the output unit starts the process off by asking for audio samples from the unit connected to its input bus. Likewise, the unit connected to the output unit asks for samples connected to its input bus. Each of those "asks" is rendering cycle.

AudioUnitRender() typically passes in a buffer of samples that your audio unit can optionally process in some way. That buffer is the last argument in the function, ioData. inNumberFrames are the number of frames being passed in by ioData. 1 is the output element or 'bus' to render for (this could change depending on your configuration). rioUnit is the audio unit in question that is doing the processing.

Apple's Audio Unit Hosting Guide contains a section on rendering which I've found helpful.