ASPiK SDK
|
We will need to decode the ChannelIOConfig variable for the audio data and pick up the audio input data samples, process them, and then write our audio outputs into the audioOutputFrame array according to the output channel IO configuration. You may adapt this code as your plug requires it. The stock processAudioFrame function your plugin is created with looks something like this at the head of the function.
From this point on, we will assume that we are processing for a FX plugin and we'll omit those enclosing curly brackets for brevity. All ASPiK plugins will by default accommodate mono-mono, mono-stereo and stereo-stereo formats. You can add more channel formats as you like. Each new blank ASPiK plugin will pass audio from input to output directly. You will then modify the code to do some meaningful processing. The audio data samples arrive in slots in the audioInputFrame and audioOutputFrame arrays and we use standard C++ array notation to access them. We might write something like this to pick up the input samples, process them through some interesting audio processing function then and pass the resulting samples to the outputs:
From this example, it should be obvious how to pick up input samples and write output samples. If we were processing a 5.1 input, we might write something like this instead:
To decode our three I/O combinations, we use the following code:
You can modify the channel decoding logic to suit your own taste. One thing to note is that this function (like all of the PluginBase functions) returns a boolean variable to signify whether we actually processed data or not. We can return true from inside each of those curly bracket sets and return false if none of our channel combinations are supported.