Skip to content

Instantly share code, notes, and snippets.

@sigmadeltasoftware
Last active March 23, 2017 13:30
Show Gist options
  • Save sigmadeltasoftware/148f0a781a992aeb755a3daa1f4df1ae to your computer and use it in GitHub Desktop.
Save sigmadeltasoftware/148f0a781a992aeb755a3daa1f4df1ae to your computer and use it in GitHub Desktop.
Android Low-Latency Audio Post-Processing with Superpowered - SuperpoweredRenderer::process() method
bool SuperpoweredRenderer::process(short int *output, unsigned int numberOfSamples) {
bool silence = !audioPlayer->process(stereoBuffer, false, numberOfSamples);
if (!silence) {
/*****************************
* APPLY PROCESSING BELOW
*/
const int nrChannels = 2;
for (int i = 0; i < numberOfSamples * nrChannels; ++i) {
stereoBuffer[i] = vibrato.processOneSample(stereoBuffer[i]);
}
/*****************************
* APPLY PROCESSING ABOVE
*/
// The stereoBuffer is ready now, let's put the finished audio into the requested buffers.
SuperpoweredFloatToShortInt(stereoBuffer, output, numberOfSamples);
}
return !silence;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment