gpt4 book ai didi

android - 适用于Superpowered音频SDK的android native中的回调

转载 作者:行者123 更新时间:2023-12-03 01:42:18 25 4
gpt4 key购买 nike

我在针对Android的 super 功能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 =新的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);
}

感谢您的任何想法!

最佳答案

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

关于android - 适用于Superpowered音频SDK的android native中的回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46269386/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com