gameforge - v0.1.12
    Preparing search index...

    Class WebAudioInstance

    A single play instance that handles the AudioBufferSourceNode.

    webaudio

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    id: number

    The current unique ID for this instance.

    prefixed: string | boolean

    Accessors

    • get filters(): PixiSound.Filter[]

      The collection of filters.

      Returns PixiSound.Filter[]

    • set filters(filters: PixiSound.Filter[]): void

      Parameters

      Returns void

    • get loop(): boolean

      If the sound instance should loop playback

      Returns boolean

    • set loop(loop: boolean): void

      If the current instance is set to loop

      Parameters

      • loop: boolean

      Returns void

    • get muted(): boolean

      true if the sound is muted

      Returns boolean

    • set muted(muted: boolean): void

      Set the muted state of the instance

      Parameters

      • muted: boolean

      Returns void

    • get paused(): boolean

      Pauses the sound.

      Returns boolean

    • set paused(paused: boolean): void

      If the instance is paused, if the sound or global context is paused, this could still be false.

      Parameters

      • paused: boolean

      Returns void

    • get progress(): number

      The current playback progress from 0 to 1.

      Returns number

    • get speed(): number

      Set the instance speed from 0 to 1

      Returns number

    • set speed(speed: number): void

      Current speed of the instance. This is not the actual speed since it takes into account the global context and the sound volume.

      Parameters

      • speed: number

      Returns void

    • get volume(): number

      Get the set the volume for this instance from 0 to 1

      Returns number

    • set volume(volume: number): void

      Current volume of the instance. This is not the actual volume since it takes into account the global context and the sound volume.

      Parameters

      • volume: number

      Returns void

    Methods

    • Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

    • Don't use after this.

      Returns void

    • Calls each of the listeners registered for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • ...args: any[]

      Returns boolean

    • Return an array listing the events for which the emitter has registered listeners.

      Returns (string | symbol)[]

    • Return the number of listeners listening to a given event.

      Parameters

      • event: string | symbol

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T

      Returns ((...args: any[]) => void)[]

    • Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optionalfn: (...args: any[]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Add a listener for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

    • Add a one-time listener for a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • fn: (...args: any[]) => void
      • Optionalcontext: any

      Returns this

    • Plays the sound.

      Parameters

      Returns void

    • Refresh loop, volume and speed based on changes to parent

      Returns void

    • Handle changes in paused state, either globally or sound or instance

      Returns void

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: string | symbol

      Returns this

    • Remove the listeners of a given event.

      Type Parameters

      • T extends string | symbol

      Parameters

      • event: T
      • Optionalfn: (...args: any[]) => void
      • Optionalcontext: any
      • Optionalonce: boolean

      Returns this

    • Set a property by name, this makes it easy to chain values

      Parameters

      • name: "paused" | "speed" | "volume" | "muted" | "loop"

        Name of the property to set.

      • value: number | boolean

        Value to set property to.

      Returns this

    • Stops the instance, don't use after this.

      Returns void

    • To string method for instance.

      Returns string

      The string representation of instance.