Last active
March 23, 2017 13:30
-
-
Save sigmadeltasoftware/148f0a781a992aeb755a3daa1f4df1ae to your computer and use it in GitHub Desktop.
Android Low-Latency Audio Post-Processing with Superpowered - SuperpoweredRenderer::process() method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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