I'm somewhat new to rails (been using it for about a month), and I'm having a problem trying to get some assets loading in development. The assets are a soundfont folder that I've placed in app/assets/javascripts. It contains acoustic_grand_piano-mp3.js, acoustic_grand_piano-ogg.js, and a folder of mp3 files. The problem I'm having is when I run the server and go to localhost:3000, the page loads, but I a 404 error that acoustic_grand_piano-mp3.js failed to load because it couldn't be found. I've checked spellings multiple times. Here's the js code (from midi.js) that runs when the page loads:
window.onload = function () {
MIDI.loadPlugin({
soundfontUrl: "./soundfont/",
instrument: "acoustic_grand_piano",
callback: function() {
var delay = 0; // play one note every quarter second
var note = 50; // the MIDI note
var velocity = 127; // how hard the note hits
// play the note
MIDI.setVolume(0, 127);
MIDI.noteOn(0, note, velocity, delay);
MIDI.noteOff(0, note, delay + 0.75);
}
});
};
Any ideas?
I recently had a problem loading an svg asset file from my Windows Server web hosting domain. It turned out that in the IIS administration panel, a custom MIME type for svg had to be entered. (It looked like ".svg", "image/svg+xml") Before this custom type was entered, the server was giving a 404 not found on the file. Maybe the same thing happened to you?