In developing a site for visually impaired persons, I envisioned a page that would autostart an audio file giving the user instrux on navigation, contents, etc. I'm on the Wordpress platform. From what I've studied I need to determine which browser is being used and load accordingly.
This script (below) works fine in Safari but when I run it under Chrome I'm getting a double playback (maybe it's playing the .ogg and .mp3 simultaneously?
Also, the .ogg file is downloaded to my downloads folder when running in Safari and when I pull up the error screen while running in Safari I get "Failed to load resource, frame load interrupted."
Thanks for taking the time to look and help. Cheers, Mike

<script language="Javascript">
function PlaySound(soundObj) {
var sound = document.getElementById(soundObj);
sound.Play();
}
</script>

<embed src="http://(audio.ogg)" autostart="true" width="0" height="0" id="sound1"
enablejavascript="true">

<embed src="(http://audio.mp3)" autostart="true" width="0" height="0" id="sound2"
enablejavascript="true">

<script language="Javascript">
var version=parseInt(navigator.appVersion);
var browser=".mp3";
if(navigator.appName=='Firefox')
{browser='.ogg';}
if(navigator.appName=='Chrome')
{browser='.ogg';}
if(navigator.appName=='Opera')
{browser='.ogg';}

if(browser=='.ogg')
{PlaySound("sound1");}
if(browser=='.mp3')
{PlaySound("sound2");}

</script>