finnkuusisto / TinySound

Simple library for playing sounds and music in Java
http://finnkuusisto.github.com/TinySound
BSD 2-Clause "Simplified" License
99 stars 26 forks source link

Limit for Sound #20

Open G0dC0der opened 10 years ago

G0dC0der commented 10 years ago

I think Sound should have a limit, which define the maximum number of times a sound can active at once(default is infinite).

So, I have a sound instance called magicSound which plays a 3 second sound:

magicSound.setLimit(2);

If I do:

magicSound.play(); magicSound.play(); magicSound.play();

The third call will be ignored since two are already playing.