So, I spent today wasting time playing tower defense, and writing a sound manager to plug in to my engine.

The way it currently it works is simple. The sound manager has a play sound method, which takes a wav filename as a parameter. This method loops through all the current buffers, and compares the file names, to see if they're the same. If it's not the same, it creates a new buffer, which contains the information to play the file. It then loop though all the sources and tries to find one that is currently not busy playing something. If it can't find one it also creats a new source.

Then after figuring out all these sources and buffers, i get the source to play the buffer - and it's done!

This still causes some issues though because, apparently, I can't have more than 30 sources at a time, and so I need to prioritise the sound so that closer objects get more priority over further away objects.

It's also a little bit annoying because there's no way of stopping sounds part way through as it stands - I may want to cut out a zombie attack sound if he gets shot mid attack, or whatever. Not really possible.

The only other thing that I should really do is set this stuff up in some sort of config file, so I can say "play zombie attack sound" instead of "play zombie_attack.wav". Not a huge issue for this game though, be nice for the engine as a whole.