Copies a rendered MIDI track into a stereo AudioBuffer of the given context. The frames are written through getChannelData, so the Float32Array views a render hands back need no conversion first.
AudioBuffer
getChannelData
Float32Array
import { parseMidi, renderMidiToBuffer, toAudioBuffer } from '@datamoc/mwg/audio';declare const context: AudioContext;declare const midiBytes: ArrayBuffer;const buffer = toAudioBuffer(context, renderMidiToBuffer(parseMidi(midiBytes))); Copy
import { parseMidi, renderMidiToBuffer, toAudioBuffer } from '@datamoc/mwg/audio';declare const context: AudioContext;declare const midiBytes: ArrayBuffer;const buffer = toAudioBuffer(context, renderMidiToBuffer(parseMidi(midiBytes)));
Copies a rendered MIDI track into a stereo
AudioBufferof the given context. The frames are written throughgetChannelData, so theFloat32Arrayviews a render hands back need no conversion first.