mwg API
    Preparing search index...

    Class OutputRecorder

    Records what flows through some nodes of a WebAudio graph as plain stereo frames, ready for AudioExport: the nodes are tapped (they keep playing to wherever they already went), a script processor collects their blocks, and stop hands back the take. The processor is the one capture node that exists everywhere, file:// pages included; it is silent, writing nothing of its own to the speakers. The take is bounded by maxSeconds, so memory cannot grow without limit.

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

    declare const context: AudioContext;
    declare const master: AudioNode;

    const recorder = new OutputRecorder(context, [master], { maxSeconds: 30 });
    // ... the player plays for a while ...
    const take = recorder.stop();
    const wav = await new AudioExport().export(take, { format: 'wav' });
    console.log(take.truncated, wav.byteLength);
    Index
    • get finished(): boolean

      whether the take is over, by stop or by reaching maxSeconds

      Returns boolean