waud.js
API Docs for v1.0.3
Show:

WaudSoundOptions

Summary

Sound Options.

Properties

autoplay

Syntax

autoplay

Bool

Summary

Auto play sound.

Default: false

autostop

Syntax

autostop

Bool

Summary

Auto stop sound when play method is called on the sound when it's already playing

Default: true

loop

Syntax

loop

Bool

Summary

Loop sound.

Default: false

onend

Syntax

onend

Function

Summary

Callback function when the sound playback ends with sound instance as parameter.

Default: null

onerror

Syntax

onerror

Function

Summary

Callback function when there is an error in loading/decoding with sound instance as parameter.

Default: null

onload

Syntax

onload

Function

Summary

Callback function when the sound is loaded with sound instance as parameter.

Default: null

playbackRate

Syntax

playbackRate

Float

Summary

Playback rate between 0 and 4.

Default: 1

preload

Syntax

preload

Bool

Summary

Whether to preload the sound or not.

Set it to true to automatically load the sound when instantiated.

Set it to false to load the sound manually using snd.load() method.

Default: true

volume

Syntax

volume

Float

Summary

Sound volume between 0 and 1.

Default: 1

webaudio

Syntax

webaudio

Bool

Summary

Whether to use web audio api or not.

Set it to false to force html5 audio even when web audio is available.

Default: true