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.
import { encodeWav, renderMidiToBuffer, parseMidi } from '@datamoc/mwg/audio';declare const midiBytes: ArrayBuffer;const wav = encodeWav(renderMidiToBuffer(parseMidi(midiBytes)));console.log(wav.byteLength); Copy
import { encodeWav, renderMidiToBuffer, parseMidi } from '@datamoc/mwg/audio';declare const midiBytes: ArrayBuffer;const wav = encodeWav(renderMidiToBuffer(parseMidi(midiBytes)));console.log(wav.byteLength);
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.