mwg API
    Preparing search index...

    Function createBudgetedLoader

    • Wraps any BusLoader in a TrackCache: the bus keeps asking by kind and name, and the cache decides what stays in memory. The key includes the kind, since a jingle and a theme may share a name.

      Parameters

      Returns BudgetedLoader

      import { AudioBus, createBudgetedLoader, type BusLoader } from '@datamoc/mwg/audio';

      declare const context: AudioContext;
      declare const decode: BusLoader;

      const load = createBudgetedLoader(decode, { maxMegabytes: 48, maxEntries: 12 });
      const bus = new AudioBus(context, { load });
      console.log(load.cache.stats());