Properties:
| Name | Type | Default | Description |
|---|---|---|---|
autoPlay |
boolean | false |
|
complete |
Function |
Global complete callback when play is finished. |
|
loaded |
Function |
Call when finished loading. Called once with an error if loading or decoding fails.
With WebAudio the error message names the file and the original error is in |
|
loop |
boolean | false |
Initial loop value, |
preload |
boolean |
|
|
singleInstance |
boolean | false |
|
source |
ArrayBuffer | AudioBuffer | HTMLAudioElement |
If sound is already preloaded, available. |
|
speed |
number | 1 |
The playback rate where 1 is 100% speed. |
sprites |
Record<string, SoundSpriteData> |
The map of sprite data. Where a sprite is an object
with a |
|
url |
string | string[] |
The source of the file being loaded |
|
volume |
number | 1 |
The amount of volume 1 = 100%. |
Members
true to immediately start preloading.
- Default Value:
- false
Global complete callback when play is finished.
Call when finished loading. Called once with an error if loading or decoding fails.
With WebAudio the error message names the file and the original error is in cause.
If no callback is given, the error is logged to the console instead.
Called once, even if play() is called while the sound is still loading.
Initial loop value, true is loop infinitely
- Default Value:
- false
true to immediately start preloading if loading from url. Calling play() while
it is still loading waits for this load; it does not start another.
true to disallow playing multiple layered instances at once.
- Default Value:
- false
If sound is already preloaded, available.
The playback rate where 1 is 100% speed.
- Default Value:
- 1
sprites Record<string, SoundSpriteData>
The map of sprite data. Where a sprite is an object
with a start and end, which are the times in seconds. Optionally, can include
a speed amount where 1 is 100% speed.
The source of the file being loaded
The amount of volume 1 = 100%.
- Default Value:
- 1