SoundJS:8
The SoundJS library manages the playback of audio on the web. It works via plugins which abstract the actual audio implementation, so playback is possible on any platform without specific knowledge of what mechanisms are necessary to play sounds.
To use SoundJS, use the public API on the Sound class. This API is for:
Controlling Sounds
Playing sounds creates AbstractSoundInstance instances, which can be controlled
individually.
createjs.Sound.alternateExtensions = ["mp3"];
createjs.Sound.on("fileload", this.loadHandler, this);
createjs.Sound.registerSound("path/to/mySound.ogg", "sound");
function loadHandler(event) {
// This is fired for each sound that is registered.
var instance = createjs.Sound.play("sound"); // play using id. Could also use full sourcepath or event.src.
instance.on("complete", this.handleComplete, this);
instance.volume = 0.5;
}
This module provides the following classes: