Di seguito riporto il codice javascript per includere dei file audio nelle proprie pagine:
<!-- if (navigator.appName == "Microsoft Internet Explorer") { document.write('<BGSOUND SRC="/sound/Mad-Hung_Up.mid" LOOP=INFINITE>') } else { document.write('<EMBED src="/sound/Mad-Hung_Up.mid" WIDTH="0" HEIGHT="0" AUTOSTART="true" LOOP="true">') } -->
Per evitare pero' che il file parta subito si puo' fare cosi':
<script language="JavaScript" type="text/javascript"> <!-- if (navigator.appName == "Microsoft Internet Explorer") { document.write('<BGSOUND id=BGSOUND_ID SRC="/sound/silence.mid" LOOP=INFINITE>') } else { document.write('<EMBED name="guitar" src="/sound/eldiablo.mid" WIDTH="0" HEIGHT="0" hidden=true AUTOSTART=false loop=false mastersound>') } ver=parseInt(navigator.appVersion) ie4=(ver>3 && navigator.appName!="Netscape")?1:0 ns4=(ver>3 && navigator.appName=="Netscape")?1:0 ns3=(ver==3 && navigator.appName=="Netscape")?1:0 function playSound() { if (ie4) document.all['BGSOUND_ID'].src='/sound/eldiablo.mid'; if ((ns4||ns3) && navigator.javaEnabled() && navigator.mimeTypes['audio/x-midi'] && self.document.guitar.IsReady() ) { self.document.guitar.play() } } function stopSound() { if (ie4) document.all['BGSOUND_ID'].src='/sound/silence.mid'; if ((ns4||ns3) && navigator.javaEnabled() && navigator.mimeTypes['audio/x-midi'] ) { self.document.guitar.stop() } } //--> </script>