Pixeljs

A simple and flexible HTML5 and JavaScript powered game engine.

View Project on GitHub Download Pixel.js (v0.9b)

Engine.addSound Method

Add a Sound to the collection of registered Sound components.

Parameters

Name Description
key The unique name to associate with the Sound.
sound The Sound to add to the collection.

Remarks

Any Sounds created using the createSound method do not have to be registered using this method, as they are automatically registered.

Examples

Supported Platforms

Google Chrome, Mozilla FireFox, Internet Explorer 9+, Opera, Safari.

The audio file formats supported varies between browsers. For a full list of formats and support visit http://www.w3schools.com/html/html5_audio.asp.