Some discoveries about adding sound
My preference for most purposes is to make a clickable hyperlink with a description of the music you will hear if you select the link. This way visitors can choose to play the music if they wish on the player their browser supports and then turn it off when they do not want to listen anymore. Here is the way to make make the link
<A HREF="voi.mid" >Listen to Bach</A> and it works like this Listen to Bach. Linking is another way to play the same midi file that I use in the examples here. People have discovered there is a "bug" with some versions of Win98 and IE right so that this method is not working for them.Examples Using EMBED
On this page in the example just above where the music does not load automatically and the example on the next page which has the music load automatically, I embedded sound to fiddle with Belov's Cross-Browser Background Music Tips, an excellent resource that is no longer online. His troubleshooting tips to test for problems on the ISP end also, especially that the server is sending the correct MIME types. Belov kept adding more tips as he got reports from users or tests on multiple browsers and MIDI players. Belov's email signature even carried the following advice: "Top reason MIDI doesn't work on your browser: You downloaded a small version of your browser from the web, and there's no MIDI plug-in in your plug-ins folder." and "Top reason MIDI doesn't work on your web site: The ISP is sending out the wrong MIME type for your MIDI files."
Zonie (fellow VU classmate who also assists with classes) advises from what he has learned through newsgroups and sources that a page loads more quickly and smoothly when you put the code for music at the very bottom of the web page. Belov confirmed that "this is true, although I [Belov] have had reports and confirmed myself that for at least one version of the QuickTime plug-in, the console must be visible on screen at the time the file loads or it will be impossible to play it. *Sigh*."
This is the code which should give most visitors a choice to turn on the music if they wish used above
<embed src="voi.mid" width="200" height="80" autostart="false" DISPLAY="SONG">
and the coding for the example I sent you to on the other page where the music loads automatically and shows a console for some visitors.<embed src="voi.mid" width="200" height="80" autostart="true">
<noembed>
<bgsound src="voi.mid">
</noembed>
The code I used for the sound to load automatically works in Netscape and for friends using Microsoft Internet Explorer 3.01 and later or WebTV. Belov notes that the quotes are required around the attributes for WebTV now. The noembed tag set around the bgsound src="voi.mid" (thanks Sal for letting me borrow your Mozart) will still allow MSIE 3.0 and earlier to interpret the bgsound.While a console shows up for me in Netscape 3.04, WebTV and some versions of MSIE will not show a control console. I want people to be able to turn off the sound if they wish. Reading further into the console tips, Belov suggested using width="200" height="80" for the console size that may not look good in some browsers but will not crash a system or cause unexpected results because it is too small. The size is really not that much bigger than what many people on the web have used for the console size of the plug-in installed with Netscape 3 on their pages who might not have known before. Notice also that you should not include use HIDE="false" in your HTML coding when you do this as this is not a valid option and you may "crash" some visitors if you use it.
The 200 x 80 is the size I use in my examples. If the plug-in your browser uses displays a smaller console than the designated size reserved for it, some browsers may show extra "gray space" for the remaining area. There is a larger square of background color showing for me than the actual size of the console because the MIDI player I use is smaller than the reserved size. (My friend on WebTV did not see space reserved for a console. When traveling to this page with win95 MSIE 3.02, Sal describes that she gets "that big old grey block like before a javascript applet loads, then a console, about 1 x 2.5 in the upper lefthand corner of the block.") Belov said that other browsers might fill in the remainder of the block with the background gif of the page so that it is just seen as a block which prevents text from being printed there. Another reason to place the code at the end of the page.
Netscape documentation about sizes depending on the browser version may not be applicable across Netscape plug-ins either. If you set the size too small, besides taking a chance on crashing some browsers or causing unexpected results, only one button to turn off the sound may show (or not enough to even do that) and you will not be able to turn it back on. If you do not set a size, MSIE does not get the console at all.
If I change the code to autostart="false", like that which is at the beginning of this section, so that people in Netscape and later versions of IE can at least turn on the music rather than have it load automatically, visitors using other browsers like WebTV may not even know that there is sound on the page because they will not have a console with the control buttons to allow them to turn on the music. Last year, an Internet friend showed us how to use a JavaScript code to allow people in IE (This was before the versions of MSIE that also recognized EMB SRC. bgsound does not have options to show a console.) to choose to turn on the music: you will miss those who cannot use JS or do not enable it. I used the default so at least they will only have to listen to the music once through rather than having it keep repeating. For sound to repeat endlessly with the EMBED SRC use loop="true" and for bgsound use loop="-1". While you can specify that the sound play a certain number of times by using LOOP with the number of times you want it to repeat, it is not recommended that you do this as it may not work the way you intend for certain browsers.
Given a choice, I would rather that some people using the"light" versions of browsers that are not configured with a plug-in not get the music (they will need to get a plug-in) rather than having complaints that there are errors for folks using IE 3.01 and later because their browsers do not know which line to interpret. It looks like MSIE may have fixed this "bug" in some of the later versions. Follow the link at the beginning of the page by Charles Belov to learn more about these issues and how to write the HTML that will work across most browsers. One of his test page examples gives a JavaScript code that works to hear the music for Netscape with JS enabled and both win 3.11 and win 95 versions of MSIE. (This outstanding site by a VU classmate is a wonderful example of how music starting automatically adds to the drama of Mysteries of the Osterraeder and I do not even want the choice to turn it off.)
Since you made it this far, here is the code to hide the control console and load automatically. (the one that some of you already do not see here.) I would make sure that your music is important to the page and not too long before using this version. Or consider the alternative of making a clickable link.
<embed src="voi.mid" hidden="true" autostart="true">
<noembed>
<bgsound src="voi.mid">
</noembed>
©1996 - 2006 Links verified 21 April 2004