phina.js.d.ts
    Preparing search index...

    Interface Sound

    interface Sound {
        context: AudioContext;
        gainNode: GainNode;
        loadError: boolean;
        loop: boolean;
        loopEnd: number;
        loopStart: number;
        notFount: boolean;
        playbackRate: number;
        serverError: boolean;
        volume: number;
        addEventListener(type: string, listener: Function): this;
        clear(type: string): this;
        clearEventListener(type: string): this;
        dispatchEvent(e: { type: string }): this;
        dispatchEventByType(type: string, param: object): this;
        fire(e: { type: string }): this;
        flare(type: string, param?: object): this;
        has(type: string): boolean;
        hasEventListener(type: string): boolean;
        isLoaded(): boolean;
        load(src: string): phina.util.Flow<phina.asset.Sound>;
        loadDummy(): void;
        loadFromBuffer(buffer?: AudioBuffer): this;
        off(type: string, listener: Function): this;
        on(type: string, listener: Function): this;
        one(type: string, listener: Function): this;
        pause(): this;
        play(when?: number, offset?: number, duration?: number): this;
        removeEventListener(type: string, listener: Function): this;
        resume(): this;
        setLoop(loop: boolean): this;
        setLoopEnd(loopEnd: number): this;
        setLoopStart(loopStart: number): this;
        setPlaybackRate(playbackRate: number): this;
        stop(): this;
    }

    Hierarchy (View Summary)

    Index

    Properties

    context: AudioContext
    gainNode: GainNode
    loadError: boolean
    loop: boolean
    loopEnd: number
    loopStart: number
    notFount: boolean
    playbackRate: number
    serverError: boolean
    volume: number

    Methods

    • Parameters

      • e: { type: string }

      Returns this

    • Parameters

      • type: string
      • Optionalparam: object

      Returns this

    • Parameters

      • type: string

      Returns boolean

    • Parameters

      • Optionalbuffer: AudioBuffer

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • type: string
      • listener: Function

      Returns this

    • Parameters

      • Optionalwhen: number
      • Optionaloffset: number
      • Optionalduration: number

      Returns this

    • Parameters

      • loop: boolean

      Returns this

    • Parameters

      • loopEnd: number

      Returns this

    • Parameters

      • loopStart: number

      Returns this

    • Parameters

      • playbackRate: number

      Returns this