0
0

I have a problem with streams and non-blocking with the last to versions of fmodex:
They never finish loading, they never get ready or return an error condition.
The funny thing is: when I use v4.03.02 or earlier, all is fine. streams are loaded as all other sounds are.
Are there any changes in v4.03.03+ in the background-streaming which I miss?

  • You must to post comments
0
0

Non-blocking streaming working OK here with v4.03.03, and now v4.03.04.

[code:15j1pgml]
bool isMusicStreamOpen(void) {
if (!musicStream) return false;
musicOpenState = FMOD_OPENSTATE_ERROR;
result = musicStream->getOpenState(&musicOpenState,0,0);
return musicOpenState == FMOD_OPENSTATE_READY;
} // isMusicStreamOpen

int playSongPostOpenState(void) {
if (musicExpVolume == 0.f) return 1;
if (musicStream && !musicStartedPlaying) {
if (isMusicStreamOpen()) {
FMOD_CHANNELINDEX channelIndex;
if (musicChannel) { // After the first song has played, reuse the channel. Should never be stolen.
channelIndex = FMOD_CHANNEL_REUSE;
} else {
channelIndex = FMOD_CHANNEL_FREE;
} // if
result = system->playSound(channelIndex,musicStream,true,&musicChannel);
ERRCHECK(result);

    lprintf("Music Channel: 0x%x (0x%x)\n",musicChannel,system);

    result = musicChannel->setPriority(0); // Highest priority: will never be stolen.
    ERRCHECK(result);
    result = musicChannel->setVolume(musicExpVolume); // Set volume with non-linearly adjusted volume level.
    ERRCHECK(result);
    result = musicChannel->setPan(0.f); // Centered. -1 = left, 1 = right.
    ERRCHECK(result);

    result = musicStream->getLength(&musicCurrentSongTotalMS,FMOD_TIMEUNIT_MS);

    result = musicChannel->setPaused(false); ERRCHECK(result);
    musicStartedPlaying = true;

  } else {
    if (musicOpenState == FMOD_OPENSTATE_ERROR) {
      musicStream->release();
      musicStream = 0;
    } // if
  } // if
} // if
return 1;

} // playSongPostOpenState

int playSongAtIndex(int index) {
if (musicPlayList.maxCount == 0) return 0;

if (index < 0) index = musicPlayList.maxCount + index;
if (index < 0) return 0;
musicCurrentSongIndex = index % musicPlayList.maxCount;
MusicEntry & me = musicPlayList[musicPlayListOrder[musicCurrentSongIndex]];
const char * musicFile = me.fileName.s();
lprintf("==> PLAYING TRACK: [%d] %s\n",musicCurrentSongIndex,me.name);

if (musicStream) {
  musicStream->release();
  musicStream = 0;
} // if

// result = system->createStream(musicFile,FMOD_HARDWARE/FMOD_SOFTWARE/|FMOD_2D|FMOD_NONBLOCKING|FMOD_IGNORETAGS,0,&musicStream);
result = system->createStream(musicFile,FMOD_SOFTWARE|FMOD_2D|FMOD_NONBLOCKING|FMOD_IGNORETAGS,0,&musicStream);
ERRCHECK(result);
musicOpenState = FMOD_OPENSTATE_ERROR; // We’ll poll until the file is ready.
musicStartedPlaying = false;
musicCurrentSongTotalMS = 0;

return 1;

} // playSongAtIndex
[/code:15j1pgml]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.