MIDI.js
MIDI.js copied to clipboard
Loading multiple instruments on Firefox tends to cause an unknown error while processing while processing decodeAudioData
If I have a setup like this
MIDI.USE_XHR = false;
MIDI.loadPlugin({
soundfontUrl:"http://gleitz.github.io/midi-js-soundfonts/MusyngKite/",
instruments: [0,4],
onsuccess: function() {
var startingPoint = MIDI.getContext().currentTime;
MIDI.noteOn(0, 50, 127, startingPoint);
MIDI.noteOn(4, 55, 127, startingPoint + 1);
}
});
I will occasionally get the error An unknown error occurred while processing decodeAudioData.
Sometimes, this can result in an "out of memory" exception or outright crash the browser
Meanwhile, I could load similar code on Chrome, loading 5 instruments, and not a single failure occurs.
This was a Firefox bug that was fixed.