mwg API
    Preparing search index...

    Class AudioExport

    The export service: renders already-synthesised frames to a WAV, FLAC or Opus file. It owns the decisions around the encoding (which formats this device can offer, a size check before the time is spent, default tags, cancellation, handing a file to the player); the bytes of FLAC and Opus come from encoders the game injects, such as the retro-audio package's exportAudio, so mwg carries no second copy of a codec. WAV is written here.

    import { AudioExport, exportTags } from '@datamoc/mwg/audio';

    declare const frames: { sampleRate: number; left: Float32Array; right: Float32Array };

    const service = new AudioExport({ defaultTags: exportTags({ game: 'Pontifex' }) });
    const bytes = await service.export(frames, { format: 'wav', tags: exportTags({ track: 'Harbour' }) });
    console.log(service.formats(), bytes.byteLength); // ['wav'] ...
    Index