Try this one, i think it is the simplest solution that anyone ever seen...:)
you just do one thing that you should convert your beep.mp3
to beep.wav
because some browsers dont understand mp3 so you should just convert it to wav and then use this only 3 lines of code
<script>
var aSound = document.createElement('audio');
aSound.setAttribute('src', 'beep.wav');
aSound.play();
</script>
this will play sound on when page is open/reload you can set it as you want, and one more thing js 1.6 or greater is required.
hope this will solve your both problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…