dot big bang

Developer API
Menu

Class SoundPlayback

All
  • Public
  • Public/Protected
  • All

Hierarchy

Index

Accessors

Methods

Accessors

finished

  • get finished(): boolean
  • true when the sound is no longer playing.

    Returns boolean

gain

  • get gain(): number
  • set gain(value: number): void
  • How loud the playing sound should be played. Ranges from 0 to 1 (inclusive).

    Returns number

  • How loud the playing sound should be played. Ranges from 0 to 1 (inclusive).

    Parameters

    • value: number

    Returns void

looping

  • get looping(): boolean
  • set looping(value: boolean): void
  • Whether the playing sound should loop when it finishes.

    Returns boolean

  • Whether the playing sound should loop when it finishes.

    Parameters

    • value: boolean

    Returns void

pitch

  • get pitch(): number
  • set pitch(value: number): void
  • A pitch multiplier for the playing sound. 1.0 means normal pitch. Less than 1.0 is slower. Greater than 1.0 is faster. Valid values are in the range (0,8]. Zero is invalid (it would stop playback).

    Returns number

  • A pitch multiplier for the playing sound. 1.0 means normal pitch. Less than 1.0 is slower. Greater than 1.0 is faster. Valid values are in the range (0,8]. Zero is invalid (it would stop playback).

    Parameters

    • value: number

    Returns void

playing

  • get playing(): boolean
  • true when the sound is playing.

    Returns boolean

Methods

stop

  • If a playing sound hasn't already finished, this function will stop it according to policy.

    Parameters

    • Optional policy: SoundStopPolicy

      If SoundStopPolicy.Immediate, will halt at the end of the current frame. If SoundStopPolicy.FinishLoop, the sound will finish playing the current (or only) loop. Default value: SoundStopPolicy.Immediate

    Returns void