Lots of sounds playing

BlitzMax Forums/BlitzMax Programming/Lots of sounds playing

deps(Posted 2005) [#1]
Hi,

In my game there is a lot of sounds being played all the time. (mostly explosions) And I guess most of you know that when two or more identical samples are being played at the same time the volume increases.
I'm soon going to do something about this in my game (after the holidays i think) and wonder what I should do.
(The games doesn't scroll like a platformer so changing the volume and/or the pan isn't an option in this case)

I'm thinking of writing a wrapper around playsound that does something like this:

* Ignore the sample if one, or at most 2-3 identical ones already are being played. Unless:
* If one identical sample have been playing for X milliseconds or more it could be stoped and restarted.

Is there anything else I should implement?
How are you doing things like this in your game?
For how long should a sample be playing before it's ok to reuse that channel?
How many channels using the same tsound should I allow?
Should I have a limit of how many channels, using different tsounds, that can be used at a time?

Not looking for codesnippets or anything. Just looking for some advice.
Thanks in advance.