我正在尝试将SuperpoweredAdvancedAudioPlayers混合并写入wav文件。我调用了recorder->start(path)
和recorder->stop()
,但没有任何内容写入磁盘。我的清单中有正确的存储权限。我用Google搜索了其他人的代码并提出了这个问题:
我的流程:
bool SuperpoweredExample::process(short int *output, unsigned int numberOfSamples) {
double masterBpm = players[0]->currentBpm;
double msElapsedSinceLastBeat = players[0]->msElapsedSinceLastBeat;
uint16_t i;
bool silence = true;
for (i=rs=0; i<NUMPLAYERS; i++) {
if (players[i]->process(stereoBuffer, !silence, numberOfSamples, volume[i] * 0.25, masterBpm, msElapsedSinceLastBeat))
silence = false;
}
if (!silence) {
recorder->process(stereoBuffer, 0, buffersize);
}
if (!silence) {
SuperpoweredFloatToShortInt(stereoBuffer, output, numberOfSamples);
}
return !silence;
}
初始化:
recorder = new SuperpoweredRecorder(tempPath, samplerate, 1);
audioSystem = new SuperpoweredAndroidAudioIO(samplerate, buffersize, false, true, audioProcessing, this, -1, SL_ANDROID_STREAM_MEDIA, buffersize * 2);
有什么想法吗?
答案 0 :(得分:0)
这可能发生在路径问题上。请检查您提交的路径是否真实可靠且可写。