views:

7

answers:

0

Hi, I'm building a game which will play a handfull of sounds all the time (rockets, rocket impacts etc). After a mere moment this turns into a real mess and i figured i need to limit the number of sounds. Problem is i don't want to decrease the number of channels of something because then one type of sound could "hog" the channels and other sounds wouldn't play.

What i need is a way to limit sounds by their filename or some other way if filename is not possible. I have tried using an int and adding and removing from that to decide whether i have hit the limit but since i dont know when a sound has stopped playing, i dont really know when to decrease the counter to make room for new sounds.