Sound

description

class for playing sounds.

new Sound(snd, vol, loop?)

snd : string
path to the audio file to use for the sound.

vol : number
the volume at which to play the sound.

loop? : boolean
whether the sound should loop upon finishing.

properties

vol
as described above.

d
the HTMLMediaElement used to play the sound.

methods

play ( )
plays the sound.

pause ( )
pauses the sound.

reset ( )
resets the sound by calling HTMLMediaElement.load().