Interface: Options

Options

Options to use for creating sounds.

Properties:
Name Type Default Description
autoPlay boolean false

true to immediately start preloading.

complete Function

Global complete callback when play is finished.

loaded Function

Call when finished loading.

loop boolean false

Initial loop value, true is loop infinitely

preload boolean

true to immediately start preloading if loading from url.

singleInstance boolean false

true to disallow playing multiple layered instances at once.

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 start and end, which are the times in seconds. Optionally, can include a speed amount where 1 is 100% speed.

url string | string[]

The source of the file being loaded

volume number 1

The amount of volume 1 = 100%.

Members

autoPlay boolean

true to immediately start preloading.

Default Value:
  • false

complete Function

Global complete callback when play is finished.

loaded Function

Call when finished loading.

loop boolean

Initial loop value, true is loop infinitely

Default Value:
  • false

preload boolean

true to immediately start preloading if loading from url.

singleInstance boolean

true to disallow playing multiple layered instances at once.

Default Value:
  • false

source ArrayBuffer | AudioBuffer | HTMLAudioElement

If sound is already preloaded, available.

speed number

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.

url string | string[]

The source of the file being loaded

volume number

The amount of volume 1 = 100%.

Default Value:
  • 1