Have a sound wav play from the beginning every time?

O

OBAFGKM_RNS

In my html, I have an embedded sound wav. I access that sound from my
javascript using Play() and Stop(). However, once stopped, the sound
will aways resume from where it left off, (making Stop behave more
like a Pause). I want it to start from the beginning.

The only way I've been able to start the sound from the beginning
every time, is to use inner.HTML to reload the embedded wav, thereby
reopening the media plugin. There is always a little hang time when
this happens.

Is it possible to have the wav play from the beginning every time
without reloading it every time? This is what I have:

in my javascript:
var sound = document.getElementById("wl1_click");sound.Play();

and in my html:
<embed id="wl1_click" src="clickb.wav" width="0" height="0"
autostart="false">
 
O

OBAFGKM_RNS

In my html, I have an embedded sound wav. I access that sound from my
javascript using Play() and Stop(). However, once stopped, the sound
will aways resume from where it left off, (making Stop behave more
like a Pause). I want it to start from the beginning.

The only way I've been able to start the sound from the beginning
every time, is to use inner.HTML to reload the embedded wav, thereby
reopening the media plugin. There is always a little hang time when
this happens.

Is it possible to have the wav play from the beginning every time
without reloading it every time? This is what I have:

in my javascript:
var sound = document.getElementById("wl1_click");sound.Play();

and in my html:
<embed id="wl1_click" src="clickb.wav" width="0" height="0"
autostart="false">

In all the hours that I've looked for help online, I never came across
"Rewind()". I just tried it and it works perfectly. I can't believe it
was that simple.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top