GeoffKnagge.com

Using Sound

This is a problem area : there is no explicit support for use of sound in the HTML 3.2 specification, even though browsers support WAV, MID, and many other sound formats. Various browsers have their own specific methods for using sound, but these are the most widely usable :
  • Use a <A> link to the sound file. Visitors will have to click on it before it is played.

  • Use the sound as an embedded object : e.g. <embed src="http://www.dot.com/sound.wav" width="140" height="60">. The sound player plug-in will be displayed, and you will need to click the play button to hear it.

  • Try a javascript "onLoad" event embedded within the BODY tag. If Javascript is supported on a visitor's browser, the sound will play once the page is loaded. For example: <BODY onLoad="window.location='http://www.dot.com/sound.wav'"}>
(C)opyright, Geoff Knagge.
Continued use of this site indicates your agreement to the Conditions of use and Privacy Policy.