Plays a random sound from an array of sounds.
const ding = new SoundGroup([ new Sound('assets/sounds/ding1.ogg'), new Sound('assets/sounds/ding2.ogg'), new Sound('assets/sounds/ding3.ogg'), new Sound('assets/sounds/ding4.ogg') ]) // When one of the sounds should play. ding.play()
Initialize SoundGroup object.
Array of sounds to select from on play.
Play a random sound from the group.
Overriding options for the sound.
Stop all sounds in the group from playing.
Plays a random sound from an array of sounds.
Example
const ding = new SoundGroup([ new Sound('assets/sounds/ding1.ogg'), new Sound('assets/sounds/ding2.ogg'), new Sound('assets/sounds/ding3.ogg'), new Sound('assets/sounds/ding4.ogg') ]) // When one of the sounds should play. ding.play()