mwg API
    Preparing search index...

    Function encodeWav

    • Writes stereo frames as a canonical RIFF/WAVE file: 16-bit PCM by default, or 32-bit float when the samples must survive unclipped. The one container every tool and browser reads, which is why the offline renders of this module go out through it.

      Parameters

      Returns Uint8Array

      import { encodeWav, renderMidiToBuffer, parseMidi } from '@datamoc/mwg/audio';

      declare const midiBytes: ArrayBuffer;

      const wav = encodeWav(renderMidiToBuffer(parseMidi(midiBytes)));
      console.log(wav.byteLength);