import { loadSoundFont, parseMidi, renderMidiToBuffer } from '@datamoc/mwg/audio';
declare const fontBytes: ArrayBuffer;
declare const midiBytes: ArrayBuffer;
const font = await loadSoundFont(fontBytes);
const rendered = renderMidiToBuffer(parseMidi(midiBytes), { soundfont: font });
console.log(rendered.duration);
Reads a SoundFont 2 or 3 into layered preset voices:
parseSoundFontfor a plain font, and a SoundFont 3 decoded first throughdecode,webAudioSampleDecoder()(the browser) unless one is given. This is what a game calls on the bytes it ships, whichever kind they are.