mwg API
    Preparing search index...

    Interface BusBudgetPolicy

    What a bus may spend on decoded tracks. A rendered five-minute stereo track at 44.1 kHz is about 100 MB, so a game that keeps every track it ever played runs a phone out of memory; these are the dials that keep it bounded.

    interface BusBudgetPolicy {
        maxEntries?: number;
        maxMegabytes?: number;
        render?: RenderBudget;
    }
    Index
    maxEntries?: number

    evict once the cache holds more than this many tracks; unlimited when omitted

    maxMegabytes?: number

    evict the least recently used track once the cache holds more than this many megabytes; unlimited when omitted

    render?: RenderBudget

    applied to a rendered MIDI track before it becomes a buffer: a length cap, mono, half rate