This page is work-in-progress. You can reach me on twitter or mail to


Instantiate an audio engine: = new SoundOnDemand();


To play a sound through the audio engine you need a channel - and you can define as many channels as you want.

Imagine channel as a tube you are shouting through. Tube can has its own properies affecting volume and effects.

this.sound ="sound"); ="music");

Play sound

Play sound through a channel."explosion");

This will look for sounds/explosion.ogg or sounds/explosion.mp3 depending on your prefered audio format and format supported by the browser and play it as soon as possible.

That's it. For more advanced features dig the documentation.

Preloading a sound

You don't have to preload audio. It gets loaded automatically on the first use and played as soon as possible. Nevertheless if you cannot any delay you can preload the sound:"laser").then(success, error);

Loader returns a Promise that is fulfilled as soon as the sound has been loaded.

Ask question:

Fork me on GitHub