mwg API
    Preparing search index...

    Class AudioSettings

    The player's audio settings in one place, over the pieces that already exist: bus volumes apply to an AudioBus (applyToBus), the preferred engine names what resolveMidiSynth is asked for first, the region and output stage describe the machine profile a retro package renders for, and captions, dynamics and soften are the accessibility dials. Everything clamps on the way in, and snapshot/restore round-trip the plain-data shape a settings screen persists.

    import { AudioSettings } from '@datamoc/mwg/audio';

    const settings = new AudioSettings({ preferredEngine: 'retro:mt32', soften: 0.4 });
    settings.setBusVolume('se', 130);
    console.log(settings.snapshot().busVolumes.se); // 100, clamped
    Index
    • the cutoff the current soften amount (and a clean stage's extra softening) asks for

      Parameters

      • sampleRate: number

      Returns number

    • one sample through the current dynamics amount

      Parameters

      • sample: number

      Returns number

    • takes the audio keys of a core.Settings custom bag in (see audioSettingsRows), so the sliders a SettingsScreen shows are the dials this class reads; keys that are absent or of the wrong kind leave the current value alone

      Parameters

      • custom: Readonly<Record<string, string | number | boolean>>

      Returns void