> The AudioUnit contains its own buffers. The C++ classes handle the data transfer between the
> AU host and the unit. Your AU code merely performs DSP on the objects' own buffers.
My reasoning here is that I could create a Generator unit that takes my app's audio data (which has arrays of multiple buffers for each track, gaps for silences, etc) and streams out with the silence rendered. This would happen when the user makes a selection of audio to apply a filter. I'm trying to avoid rendering the *entire* range of frames + selection of tracks before displaying the AudioUnit UI.
And while the user is tweaking the third party effect, I need some way to preview the audio, properly mixed... not sure how to that exactly yet :( Then finally, I'll need to take the rendered audio, and copy it back to my app's audio data.
> If all you need is an AU host, then why wrap any audio rendering in Swift?
I'm mainly looking for a way to avoid copying the entire selection at once before displaying the third party AudioUnit window. I can't just make an AudioBufferList by reference, because of the mixing, and silent areas. My assumption, which might be horribly wrong, is that the best way to send data would be to use an AU that knows how to convert between the custom data structure I use to organize my buffers, and a normal ABL.
Not sure if my message is even making sense here. No doubt about it, I'm foggy about the right way to do all this!
> Do you even need to write an AudioUnit?
It just occurred to me though, that Apple probably has some generic "Generator" AU that I could send just a "render callback" to, like you can do with the "Output" (i.e.: kAudioUnitType_Output). I should take a look at documentation again...
I don't know enough yet about how AudioUnits work... but I'm not sure I understand how an AUGraph would help me do this. I had intended to pipe a custom AU generator to the third party effect, and back to output for the user to hear, and later to a custom offlline AU to package the output back to my softfile. Sigh, confusing!