0

I'm having trouble implementing the SuperpoweredRecorderStoppedCallback in the superpowered sdk for android. I was trying to set it up just like the player callbacks in the CrossedExample, but I must be missing something.

static void recordCallback(void *clientData) {
    __android_log_print(ANDROID_LOG_DEBUG, "LOG_callback record", "text:%i ", 
clientData);
};

Then I try to set up the recorder like the players - I have it recording audio just fine, but I receive no callback.

SuperpoweredExample::SuperpoweredExample(unsigned int samplerate, unsigned int buffersize, const char *path, int fileAoffset, int fileAlength, int fileBoffset, int fileBlength, const char *testPath[]) : activeFx(0), crossValue(0.0f), volB(0.0f), volA(1.0f * headroom) {
stereoBuffer = (float *)memalign(16, (buffersize + 16) * sizeof(float) * 2);
stereoBufferRecording = (float *)memalign(16, (buffersize + 16) * sizeof(float) * 2);
this->sampleRate = sampleRate;

playerA = new SuperpoweredAdvancedAudioPlayer(&playerA , playerEventCallbackA, samplerate, 0);
playerA->open(path, fileAoffset, (fileAlength));
playerB = new SuperpoweredAdvancedAudioPlayer(&playerB, playerEventCallbackB, samplerate, 0);
//playerB->open(path, fileBoffset, (fileBlength));
playerB->open(testPath[1],0,0);

playerA->syncMode = playerB->syncMode = SuperpoweredAdvancedAudioPlayerSyncMode_TempoAndBeat;

roll = new SuperpoweredRoll(samplerate);
filter = new SuperpoweredFilter(SuperpoweredFilter_Resonant_Lowpass, samplerate);
flanger = new SuperpoweredFlanger(samplerate);

recorder = new SuperpoweredRecorder(temp, samplerate,1,2,false, recordCallback, __null);

audioSystem = new SuperpoweredAndroidAudioIO(samplerate, buffersize, false, true, audioProcessing, this, -1, SL_ANDROID_STREAM_MEDIA, buffersize * 2);
audioSystemRecording = new SuperpoweredAndroidAudioIO(sampleRate, buffersize, true, false, audioProcessingRecording, this, buffersize * 2);
}

Thanks for any thoughts!

1 Answers1

0

The callback is called a little bit after you call recorder->stop(). Please note, you're passing NULL for the clientData, which then you try to print.

Gabor Szanto
  • 1,329
  • 8
  • 12
  • I have the recorder set up and working, but I don't see anything print after recorder->stop(). I've tried passing other data besides NULL with no effect. My player callbacks work and print fine. This looks generally correct though? – Joshua Crist Sep 20 '17 at 13:07
  • Your recordCallback is correct, if you fix that log print. – Gabor Szanto Sep 28 '17 at 09:14