0
0

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?

  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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
Daniel

  • You must to post comments
0
0

Actually I thought of a much better solution, assuming you have a few spare MB you could load the sound into memory yourselves outside the FMOD memory pool and then let FMOD open the sound as FMOD_OPENMEMORY_POINT.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.