Skip to content

Instantly share code, notes, and snippets.

@sigmadeltasoftware
Last active March 23, 2017 13:07
Show Gist options
  • Save sigmadeltasoftware/c31cb5e484c8f912ada879c887d485ee to your computer and use it in GitHub Desktop.
Save sigmadeltasoftware/c31cb5e484c8f912ada879c887d485ee to your computer and use it in GitHub Desktop.
Android Low-Latency Audio Post-Processing with Superpowered - SuperpoweredRenderer constructor
SuperpoweredRenderer::SuperpoweredRenderer(unsigned int samplerate, unsigned int buffersize, const char *path, int fileLength) {
/*
* According to the SuperpoweredAdvancedAudioPlayer::process method, the size of our buffer should be: numberOfSamples * 8 + 64 bytes big
*/
stereoBuffer = (float *)memalign(16, (buffersize * 8) + 64);
audioPlayer = new SuperpoweredAdvancedAudioPlayer(&audioPlayer , playerEventCallbackA, samplerate, 0);
audioPlayer->open(path, 0, fileLength);
audioSystem = new SuperpoweredAndroidAudioIO(samplerate, buffersize, false, true, audioProcessing, this, -1, SL_ANDROID_STREAM_MEDIA, 0);
vibrato.initialize(44100);
vibrato.setDepth(0.0f);
vibrato.setFrequency(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment