like2d
    Preparing search index...

    Interface Audio

    The audio subsystem.

    Manages a handful of AudioSource objects, for things like global volume, global play/pause, etc..

    To make a new source, use like.audio.newSource.

    interface Audio {
        clone(source: AudioSource): AudioSource;
        getAllSources(): AudioSource[];
        getVolume(): number;
        newSource(path: string, options?: AudioSourceOptions): AudioSource;
        pauseAll(): void;
        resumeAll(): void;
        setVolume(volume: number): void;
        stopAll(): void;
    }
    Index

    Methods

    • Get all audio sources -- note that sources are tracked using weak references, and storing this list can cause a memory leak.

      Returns AudioSource[]

    • Parameters

      • volume: number

      Returns void