超级强大的AdvancedAudioPlayer。如何等待缓存?

时间:2018-07-09 12:39:20

标签: superpowered

我正在使用超级功能的sdk播放音频文件。我需要等待SuperpoweredAdvancedAudioPlayer缓存文件。这是我尝试过的伪代码:

void loading (shared_ptr<SuperpoweredAdvancedAudioPlayer> player, string path)
{
    player->open(path.c_str());
    player->cachePosition(0, 0);
}

int main ()
{
    string filePath = "/path/file.wav";

    shared_ptr<SuperpoweredAdvancedAudioPlayer> player;
    player = make_shared<SuperpoweredAdvancedAudioPlayer>(nullptr, nullptr, 44100, 10, 2, 0);
    thread Loading(loading, player, filePath);
    char *tmp = (char*)&player->waitingForBuffering;
    Loading.join();
    while (*tmp) {usleep(10000);}

    return 0;
}

这对我不起作用。等待时间为true。 有效的等待方式是什么?

0 个答案:

没有答案