As a sort of personal project to keep busy over the summer and to start learning new things (like working with audio) I decided to write up a small player in C++ that emulates a very popular music-simulation game: beatmania.
However, basing the sound manager off of the FMOD starter code give some unexpected and unfortunate results: running out of memory (and lots of crashes if FMOD_HARDWARE is defined for initialization).
To describe beatmania, it’s a simulation where the player has to hit several keys based off a chart to make sounds. There are songs with over 300 individual sounds and over 3000 discrete points at which a key needs to be pressed and a sound needs to be played, most of them are small (a handful of kb) but some automatic BGMs can be a full-length song.
So after wrangling with this almost all night, I decided to fess up to the fact that the documentation makes no sense to me and ask people who have experience.
- haysupimark asked 12 years ago
expereience in what? beatmania? You have to be very specific with the fmod issue you are having for us to give a good answer.
If you are running out of memory maybe the sounds you are loading are too big, and you are supposed to be using streams possibly?
If you haven’t, I would recommend reading the documentation in the tutorials section. There are plenty of tips on basic concepts and memory issues etc.
Well, in a day I learned a lot about memory management.
And an even more important lesson in logic.
I read "call update() once per frame" way too literally- and called it in the main loop that handles all the graphical update()’s and render()’s. However, that loop has a fixed rate, so the sound is played in a seperate thread. moving update() there solved most of the problems.
- haysupimark answered 12 years ago
Please login first to submit.