I have a song here which causes fmod to loop strangely inside the file, forever. If played in other players (eg: winamp), this doesn’t happen. I tried this with the example FMOD.EXE application. Please advise.
I’m trying to “play all .IT files in a folder”, and obviously, I’m never getting past files like this one, or some that just don’t trigger “FMUSIC_IsFinished” for some reason, even though they seem to get to the end.
http://www.modarchive.com/cgi-bin/downl … forestr.it
- malachii asked 15 years ago
I found u can not trust the result of FMUSIC_IsFinished. I has to manually calculate my times, and figure out if it ended by myself, its not totally accureate atm, but its very close, usally with a + of about 12 seconds.
What I do is…Open the file quickly start it playing then preform the following within VB
i = GetBPM()
s = GetSpeed()
k = ((i * 2) / 5) st = ((1 / k) * 1000) * s mySong.SongDescription.KBPS = k Orders = GetNumOrders() - 1 For i = 0 To Orders t = t + FMUSIC_GetPatternLength(mySong.songHandle, i) Next i mySong.SongDescription.SongLenghtInBytes = t mySong.SongDescription.SongLenghtInMS = t * st
Then I stop it playing. The song in bytes is wrong i believe, its acutally the song lenght in rows, but close enough. It is very close in correct time usually like i said a few seconds off. If the song don’g change speeds at all its almost dead on.
Rummor has it Brett is currently adding to FMUSIC to enable us to read through the rows looking for speed changes and other things, this would make the calculations alot more accurate.
All u need to do then is check the current playing time vs the length to know if it should have ended or not.
I hope this helps you out.
<font size=-1>[ This Message was edited by: Cire on 2002-03-10 23:11 ]</font>
Please login first to submit.