We have a 15Mb buffer for Fmod to play all of it’s sounds. In the menus we have written a music system that loads an entire event (MP3s) into memory, plays it, and once it is finished, unloads the track, loads the entire next track and then plays it, etc. The first time into menus this works fine and the memory sits at about 7Mb. Next we go into game after unloading the track, the memory goes to about 10Mb, then when we exit and go back into the menus, Fmod returns error 44 (not enough memory) and the current usage sits at about 3Mb!!!
Now, if we increase the buffer to 16Mb, the music works fine the second time into Menus and sits at about 8Mb (The first time into game we load some more sound resources that are not unloaded).
The theory we have is that this 15Mb buffer is getting fragmented so Fmod cannot allocate a buffer big enough for the music file.
My question is this: Is there some way to find out the maximum size of an allocation we can make through Fmod?
- DanielGuy asked 8 years ago
No there is no way to know what the maximum allocation you can make is. It is quite unusual to be loading entire songs into memory. Is there a reason you’re not using streams?
If you [i:9ruhh6jo]have[/i:9ruhh6jo] to do it this way you can override the FMOD memory callbacks and make a custom memory management system.
We originally had the music streaming but in our menus we are streaming other data as well, which was causing the disk to thrash and all the badness associated with that.
Loading the entire song into memory means that there is no issue with thrashing/stuttering.
Thanks for your quick reply
- DanielGuy answered 8 years ago
Please login first to submit.