melonJS
    Preparing search index...

    Interface SoundAsset

    Sound asset descriptor passed to audio.load.

    interface SoundAsset {
        autoplay?: boolean;
        html5?: boolean;
        loop?: boolean;
        name: string;
        src: string;
        stream?: boolean;
    }
    Index

    Properties

    autoplay?: boolean

    Begin playback immediately on load. Defaults to false.

    html5?: boolean

    Force the HTML5 <audio> element backend instead of WebAudio decoding. Defaults to false.

    loop?: boolean

    Loop playback when the clip ends. Defaults to false.

    name: string

    Logical name used to play / stop / reference the sound later.

    src: string

    Base path / prefix for the audio resource. The loader builds the full URL as ${src}${name}.${ext} for each format configured by audio.init(), so src is typically a directory ending in /. Data URLs (data:audio/...) are used as-is and skip the prefix

    • extension construction.
    stream?: boolean

    Stream the resource instead of fully decoding upfront — preferred for long music tracks. Defaults to false.