I’ve run into a weird issue with FMOD not wanting to loop MIDI files if I use createStream instead of createSound. Using createSound() works as intended.
It’s fairly straightforward. Running in debug mode doesn’t show anything weird. At the end of the MIDI it will just just say that the thread finished with return code 0.
Its hard for the stream to know the length of the stream at the time of opening, so by default it will either guess or set the length to -1 (0xfffffff) which is in effect ‘infinite’ length. This is the same issue with mod/s3m/xm/it, and to some extent, VBR mp3 files.
This is why you have to ‘preprocess’ the file at the start, to work out the correct length, so it can loop properly. This is done by using the FMOD_ACCURATETIME flag.
Hi, i’ve looked into this further, and you don’t need to use FMOD_ACCURATETIME with midi files, as it can calculate the length without it (so it applies more to mod/s3m/xm/it).
I can see an issue was introduced in 1.09.00 , which was a side effect of reducing memory overhead. Unfortunately it stops a midi file from looping, so i’ve created a fix for this for the next 1.09 release.
Workarounds are to use the latest 1.08 release instead, or use createSound instead of createStream when loading a midi file.
Alright, thanks a lot. Guessing it was a part of that overhaul huh? I’m surprised I’ve found these issues. FMOD does work really well for almost anything.