Reputation: 8655
Im in the final steps of my Flash game, now I have to take care of the music/sound.
And, I figure out that I'd need to reproduce several sounds simultaneously, sounds like gun shots, explosions, screams, etc, however, these sounds are short, < 1 seconds.
So, how many sounds can I reproduce at the same time?, and what would be the best approach (what class to use, how, tips, etc) to achieve this?, considering my situation.
Thx in advance.
Upvotes: 0
Views: 555
Reputation: 700
You can produce as many as you want, although the results might not be what you expect. I was having 10+ firing sounds playing at the same time and it sounded terrible. I would suggest you implement some hard-limit for the amount of sounds of one type.
Take a look at what Colby from Cheezeworld did with his SoundManager class.
You can download the full source from the google code repository.
Upvotes: 1
Reputation: 2941
I have never run into a limit on the number of Sound instances I have created, but I can't think of the max. I did a game a few months ago that probably had twenty or so going at the same time.
It is quite easy, though, to overload and distort the stereo output. If you are planning on many sounds at the exact same time, you will probably need to adjust the volume of each via SoundTransform from the SoundChannel that gets returned when you play. Or, you can adjust the level in the audio file itself.
Upvotes: 0