Options
All
  • Public
  • Public/Protected
  • All
Menu

AudioClip is an instance of audio playback. It is created by AudioManager.play() and should not be created explicitly

Hierarchy

  • AudioClip

Index

Constructors

constructor

  • new AudioClip(id: number, group: string, sprite: string): AudioClip
  • Parameters

    • id: number
    • group: string
    • sprite: string

    Returns AudioClip

Accessors

id

  • get id(): number
  • Returns number

isPlaying

  • get isPlaying(): boolean
  • Returns boolean

loop

  • get loop(): boolean
  • set loop(on: boolean): void
  • Returns boolean

  • Parameters

    • on: boolean

    Returns void

name

  • get name(): string
  • Returns string

onEnd

  • get onEnd(): Function
  • set onEnd(callback: Function): void
  • Set a callback function that is invoked when the end of the audio is reached (note if looping it will be invoked each time the end of audio is reached)

    Returns Function

  • Set a callback function that is invoked when the end of the audio is reached (note if looping it will be invoked each time the end of audio is reached)

    Parameters

    • callback: Function

      Function to invoke

    Returns void

onStop

  • get onStop(): Function
  • set onStop(callback: Function): void
  • Set a callback function that is invoked whenever the audio stops. This occurs when the audio is explicitly stopped or the end of the audio is reached (when not looping)

    Returns Function

  • Set a callback function that is invoked whenever the audio stops. This occurs when the audio is explicitly stopped or the end of the audio is reached (when not looping)

    Parameters

    • callback: Function

      Function to invoke

    Returns void

rate

  • get rate(): number
  • set rate(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

sprite

  • get sprite(): string
  • Returns string

volume

  • get volume(): number
  • set volume(value: number): void
  • The volume of the audio clip [0.0 .. 1.0]

    Returns number

  • The volume of the audio clip [0.0 .. 1.0]

    Parameters

    • value: number

    Returns void

Methods

onCompleted

  • onCompleted(event: string): void
  • Parameters

    • event: string

    Returns void

pause

  • pause(): void
  • Returns void

resume

  • resume(): void
  • Returns void

stop

  • stop(): void
  • Returns void