Sound Effects

BlitzMax Forums/BlitzMax Beginners Area/Sound Effects

mothmanbr(Posted 2007) [#1]
I want to be able to configure the music and sound volume in my game, and it seems that to do that I need to use channels, not just "Playsound" or have a single channel(as the sound would be cut off once a new one starts playing). I was thinking of a few solutions, and I don't know which one(if any) would be the best one:

1. Every object has his own channel and sound effect, so it can play any sounds it wants, without being cut out. But I guess that would use more memory/resources.

2. A Sound Effects class, that has a play sound function and receives a sound as parameter, or a index to get the sound in a matrix inside the class. That function will create a channel with the volume set by the user, and play the sound in that channel, and then destroy said channel.

Which one is better? If neither, what can I do? Any improvements suggestions? Thanks in advance.