0
0

code segment is the following:

A> callback function
FMOD_RESULT F_CALLBACK nonblockcallback(FMOD_SOUND *sound, FMOD_RESULT result)
{
FMOD::Sound *snd = (FMOD::Sound *)sound;
FMOD_OPENSTATE state;
FMOD::Channel *channel = NULL;
TCHAR tmpErrBuf[MAX_PATH];

result = snd->getOpenState(&state, 0, 0);

if (state == [color=red:6rtk8rhn]FMOD_OPENSTATE_BUFFERING[/color:6rtk8rhn] && !channel)
{
result = System->playSound(FMOD_CHANNEL_FREE, snd, false, &channel);
}
return FMOD_OK;
}

B>main thread:
memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.nonblockcallback = nonblockcallback;
result = System->createStream("E:/music/10.mp3", FMOD_NONBLOCKING|FMOD_LOOP_NORMAL, &exinfo, &sound);

just according the reference, status that is ready to play can playback, why does the buffering status do this? I try a loop in the callback function to wait for ready status, but never get it? What is the problem? Can any words to explain every status(loading, buffering, ready to play…)

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.