Add background music and sound effects to a browser-based game that works on Chrome, Firefox, and Safari without writing separate audio code for each.
Preload audio files alongside images using the PreloadJS integration before your app or game starts.
Play audio inside a Cordova-based mobile app using SoundJS's dedicated Cordova plugin.
SoundJS is a JavaScript library that makes it easier to play audio in a web browser. The core problem it solves is that different browsers handle audio in different ways, so code that plays a sound correctly in one browser might fail silently in another. SoundJS provides a single consistent interface that works across browsers, so you write the audio logic once and the library handles the differences underneath. When you tell SoundJS to play a sound, it creates a sound instance that you can control: you can pause it, mute it, stop it, adjust the volume, or change the position in the track. This works the same way regardless of which browser or playback method is being used behind the scenes. The library uses a plugin system to handle the actual audio playback. By default it uses the Web Audio API, which is the modern browser standard for audio. If that is not available, it falls back to HTML5 audio, which is supported in older browsers. Additional plugins are available for Cordova-based mobile apps (such as those built with PhoneGap or Ionic) and for Flash, though the Flash plugin is mainly there as a last resort for very old environments. SoundJS also connects to PreloadJS, another library in the CreateJS family, which handles loading assets before they are needed. This pairing means you can preload your audio files along with images and other resources in a coordinated way. The library is released under the MIT license, meaning it can be used in personal and commercial projects without charge. It was built by gskinner.com. The README is brief and the project appears to be in maintenance mode rather than active development.
← createjs on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.