Question: What browsers can execute scripts that play sound?
The techniques described in Playing Sound
work in Microsoft Internet Explorer 4.0 and newer
as well as Netscape Navigator 3.0 and newer.
it's enough to test that the browser version is 4.0 or newer.
In Netscape Navigator,
you'll have to make sure that
the browser version is 3.0 or newer
the browser recognizes the mime-type of the audio file
you want to play
the LiveAudio plugin is ready to play
For example, if you want to play the sound file
specified in the following EMBED tag
<EMBED NAME="mySound" SRC="mySound.mid"
LOOP=FALSE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>
then the necessary tests can be performed using this code:
if (ver>2 && navigator.appName=="Netscape"
&& document.mySound.IsReady() )
// put Netscape-specific code here
if (ver>3 && navigator.appName.indexOf("Microsoft")!=-1)
// put Explorer-specific code here
© 1999-2006, Alexei Kourbatov