0
0

In old FMOD, I could use the FMOD_Music functions to determine if a tracker file like .it or .s3m was done playing. In FMOD Ex, I’m trying to determine if the song is done like this:

pSong->getLength(&iLength, FMOD_TIMEUNIT_MS);
m_pMusicChannel->getPosition(&iPosition, FMOD_TIMEUNIT_MS);

if(iPosition >= iLength)
PlayNextSong();

The problem is that iLength ends up being some outrageous number in the billions, even though the getLength doesn’t return an error code. When I load a .it file in the playStream sample that comes with the SDK, it shows several thousand minutes left in the song.

[edit] I’ve also tried doing the FMOD_CHANNEL_CALLBACKTYPE_END callback. It works great for WAV’s and MP3’s, but is never called for a mod or s3m file, even after I set the looping to none and reset the position:
m_pMusicChannel->setMode(FMOD_LOOP_OFF);
m_pMusicChannel->setPosition(0, FMOD_TIMEUNIT_MS);

How can I tell if a song is really done playing?

~BenDilts( void );

  • You must to post comments
0
0

Tracker modules don’t have a length. They can loop infinitely.

  • You must to post comments
0
0

Perfect! Thanks for the quick response.

~BenDilts( void );

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.