1st off:
You could controle sound using next methods:
<script>
function start() {
document.all.sound.play();
//document.all.sound.stop();
}
</script>
<body onload="document.all.sound.play()">
<embed src="sound.wav" autoplay="true" name="sound"></embed>
<A href="#" onmouseover="start()">START</A>
</body>
this doesn't seem to work on all PCs though, probably has something to do with sounds being played by different plugins. Both my PCs that had realplayer installed wouldn't accept the play() and stop() methods.
A workaround this problem is each time you wanna start a sound and stop it , re-initiate the sound source and times it has to loop.
1: put ur sound as backgroundsound.
<bgsound src="#" id=sound loop=1 autostart="true">
2: to start the sound do
document.all.sound.loop=5000
document.all.sound.src= 'typewriter.wav'
to stop the sound do
document.all.sound.loop=0
document.all.sound.src= 'typewriter.wav'
it may not be the cleanest solution, but it seemed to work on all my PCs running IE.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.