Module gamejs/mixer
Playing sounds with the html5 audio tag. Audio files must be preloaded
with the usual gamejs.preload() function. Ogg, wav and webm supported.
Sounds & Images are loaded relative to './'.
Functions
- getNumChannels()
- setNumChannels(count)
Sound (uriOrAudio)
Sounds can be played back.
Parameters
| String|dom.AudioElement | uriOrAudio | the uri of |
Sound.prototype.play (loop)
start the sound
Parameters
| Boolean | loop | whether the audio should loop for ever or not |
Sound.prototype.setVolume (value)
Set volume of this sound
Parameters
| Number | value | volume from 0 to 1 |
Sound.prototype.stop ()
Stop the sound. This will stop the playback of this Sound on any active Channels.
setNumChannels (count)
Sets the number of available channels for the mixer. The default value is 8.
Parameters
| count |