gameforge - v0.1.12
    Preparing search index...

    Interface IMediaContext

    Represents the audio context for playing back sounds. This can represent either an HTML or WebAudio context.

    interface IMediaContext {
        audioContext: AudioContext;
        filters: PixiSound.Filter[];
        muted: boolean;
        paused: boolean;
        speed: number;
        volume: number;
        destroy(): void;
        refresh(): void;
        refreshPaused(): void;
        toggleMute(): boolean;
        togglePause(): boolean;
    }

    Implemented by

    Index

    Properties

    audioContext: AudioContext

    Reference to the Web Audio API AudioContext element, if Web Audio is available

    filters: PixiSound.Filter[]

    Collection of global filter

    muted: boolean

    true if all sounds are mute

    paused: boolean

    Set the paused state for all sound

    speed: number

    The speed of all sound

    volume: number

    Volume to apply to all sound

    Methods

    • Destroy the context and don't use after this.

      Returns void

    • Dispatch event to refresh all instances volume, mute, etc.

      Returns void

    • Dispatches event to refresh the paused state of playing instances.

      Returns void

    • Toggle mute for all sounds

      Returns boolean

    • Toggle pause for all sounds

      Returns boolean