Midi Files and Wave Files may be embedded and automatically played when a user hits your web site using a couple of methods (again dependent upon the browser.) - Microsoft Internet Explorer supports embedding a background sound to a web page using the <bgsound> tag. See the following example:
<bgsound src="my-sound.mid" loop=0">
This would appear to be the most logical way to embed a sound file. The only difference is I think this should be included in the <background> tag, but hey, who am I to tell everyone else how to do html right?
The Loop parameter identifies how many times through the midi file should be played. You can set this value to any number or to define an infinite loop, set the value to "-1" as shown in the following example:
<bgsound src=" my-sound.mid " loop=-1">
The following is the embed tag:
<embed src=" my-sound.mid ">
As you can see there isn't a whole lot of differences between the two with the exception of the tag name. You can place both tags in your documents and both browsers will support playing the midi files.
NOTE: The same is true for embedding wave files. Simply use the <bgsound> or <embed> tags to link to the .wav file.