在Android本机中为Superpowered音频SDK回调

时间:2017-09-17 22:17:48

标签: android audio superpowered

我在Android的超级强大的sdk中实现SuperpoweredRecorderStoppedCallback时遇到了麻烦。我试图像CrossedExample中的玩家回调一样设置它,但我必须遗漏一些东西。

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

然后我尝试像播放器一样设置录音机 - 我录制音频就好了,但我没有收到回叫。

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);
}

感谢您的任何想法!

1 个答案:

答案 0 :(得分:0)

在调用recorder-> stop()后调用回调。请注意,您为clientData传递NULL,然后尝试打印。