Fork me on GitHub A javascript library for working with html5 audio

 

a javascript library for working with
html5 audio

SoundJS v0.1
First official alpha release of SoundJS. Download now.

links: download source, API documentation, GitHub repository

Audio in HTML is promising, but can be quite difficult to work with. Each browser has a similar but different approach, which requires a lot of guess and test, and edge cases, which can add up to a lot of time spent. The SoundJS JavaScript library provides a simple API, and some powerful features to make working with audio a breeze.

examples: Convolution, Interrupt, Dynamic Instances, Master Volume, A Game, Test Suite

For an example of SoundJS being used in a large-scale project, see Pirates Love Daisies, which uses techniques and approaches that were eventually rolled into SoundJS.

SoundJS was built by gskinner.com, and is released under the MIT license, which means you can use it freely for almost any purpose (including commercial projects). We appreciate credit where appropriate, but it is not a requirement.

SoundJS is currently in early alpha. We will be making significant improvements to the library, samples, and documentation over the coming weeks. Please be aware that this may necessitate changes to the existing API.

companions: SoundJS works great with EaselJS

In our preliminary testing, SoundJS appears to be fully compatible with Android, and all major desktop browsers that support the canvas element.

The key features are:

Channel Management

Deals with the maximums in different browsers, as well as helping determine the best channel to interrupt when dealing with multiple sounds of the same kind.

Batch Loading

Manages the preloading of a sound queue.

Master Volume Control

Control individual sound volume, or the volume of all sound channels at once, including muting.

Have a look at the full API documentation for more info.

Planned updates

SoundJS will be updated as time permits. We're not making any promises, but here are some of the things we're thinking of doing: