Class Index | File Index

Classes


Class AudioManager

Provides a way to load and play back .wav file sound effects.
Defined in: audio.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Load chunks of audio and play them by name.
Method Summary
Method Attributes Method Name and Description
 
load(url, name)
Load a sample to play later.
 
play(name)
Play a sound.
Class Detail
AudioManager()
Load chunks of audio and play them by name. Only .wav files are really supported on all browsers. You could try .mp3 or .ogg but they probably won't work on all browsers. There is no way to get progress feedback on whether sounds are loaded yet, sorry, so use short sounds. Google 'sfxr' for an excellent sound effects generator.
Method Detail
load(url, name)
Load a sample to play later.
Parameters:
url
is the path to the file to load.
name
is optional and is used to identify your sample for playing. If not supplied the filename minus the extension will be used.

play(name)
Play a sound.
Parameters:
name
identifies which sound to play.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Nov 09 2012 21:19:31 GMT+0800 (WST)