fix Issue #14
This commit is contained in:
parent
9c8721eab4
commit
079d548fa2
2 changed files with 3 additions and 3 deletions
|
@ -112,9 +112,6 @@ root.loadFile = function (file, callback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
var title = file.split(" - ")[1] || file;
|
|
||||||
document.getElementById("playback-title").innerHTML = title.replace(".mid","");
|
|
||||||
///
|
|
||||||
var fetch = new XMLHttpRequest();
|
var fetch = new XMLHttpRequest();
|
||||||
fetch.open('GET', file);
|
fetch.open('GET', file);
|
||||||
fetch.overrideMimeType("text/plain; charset=x-user-defined");
|
fetch.overrideMimeType("text/plain; charset=x-user-defined");
|
||||||
|
|
|
@ -137,6 +137,9 @@ if (window.AudioContext || window.webkitAudioContext) (function () {
|
||||||
var synth = MIDI.GeneralMIDI.byName[instrument];
|
var synth = MIDI.GeneralMIDI.byName[instrument];
|
||||||
var instrumentId = synth.number;
|
var instrumentId = synth.number;
|
||||||
var url = urlList[index];
|
var url = urlList[index];
|
||||||
|
if (!MIDI.Soundfont[instrument][url]) { // missing soundfont
|
||||||
|
return callback(instrument);
|
||||||
|
}
|
||||||
var base64 = MIDI.Soundfont[instrument][url].split(",")[1];
|
var base64 = MIDI.Soundfont[instrument][url].split(",")[1];
|
||||||
var buffer = Base64Binary.decodeArrayBuffer(base64);
|
var buffer = Base64Binary.decodeArrayBuffer(base64);
|
||||||
ctx.decodeAudioData(buffer, function (buffer) {
|
ctx.decodeAudioData(buffer, function (buffer) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue