API

Interface IStaticSoundPlayOptions

Options for playing a static sound.

interface IStaticSoundPlayOptions {
    duration: number;
    loop: boolean;
    loopEnd: number;
    loopStart: number;
    startOffset: number;
    volume: number;
    waitTime: number;
}

Hierarchy (View Summary)

Index
duration: number

The amount of time to play the sound for, in seconds. Defaults to 0.

  • If less than or equal to 0, the sound plays for its full duration.
loop: boolean

Whether the sound should loop. Defaults to false.

loopEnd: number

The end of the loop range in seconds. Defaults to 0.

  • If less than or equal to 0, the loop plays for the sound's full duration.
  • Has no effect if loop is false.
loopStart: number

The start of the loop range in seconds. Defaults to 0.

  • If less than or equal to 0, the loop starts at the beginning of the sound.
  • Has no effect if loop is false.
startOffset: number

The time within the sound buffer to start playing at, in seconds. Defaults to 0.

volume: number

The volume/gain. Defaults to 1.

waitTime: number

The time to wait before playing the sound, in seconds. Defaults to 0.