THREAD NAVIGATION:
Where am I? Original message Top of thread Current page
Displays all thread messages Displays thread map That to which this responds This thread's lead message Your most recent Tavern page

I don't get music, but I do also know why .
01/06/2019, 18:22:48

    Ramillies writes:

    It has to do with the way the individual music pages are written. It looks like they've been written back in the times when getting a browser to reliably play anything was a major pain.

    I had a look at the source, and saw that you use two different tags to play the music. The first one is the <bgmusic> Micro$oft's own tag that was only ever recognized by Internet Explorer; and the second is the <embed>, which is recognized by pretty much all browsers, but it essentially just tells the browser "here, have this file and try to display it somehow", which can lead to pretty random results, depending on the target browser and its configuration.

    There is a way to fix it, however: today, we have HTML 5, which is widely supported, and with HTML 5 there comes the <audio> tag. So that is a very reliable way of getting the audio played in the vast majority of browsers. The only problem is that it supports only MP3, WAV and OGG formats, so the MIDI files would have to be converted first. If you would like to go this way, I could easily convert the files and send you the results (it would be probably 2 minutes of work for me; and I also have quite a good soundfont, so some people could actually get better playback with this). The downside is that it would take a couple of megabytes on the server's disk and it wouldn't be 56k friendly anymore, if anybody still uses that .

    (The code itself would be very simple: you would just write something like <audio autoplay loop controls src="whatever-music.ogg" /> and that's it.)





Reply to this message Back to the Tavern