Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Have a sound wav play from the beginning every time?

Reply
Thread Tools

Have a sound wav play from the beginning every time?

 
 
OBAFGKM_RNS@yahoo.com
Guest
Posts: n/a
 
      07-03-2008
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">
 
Reply With Quote
 
 
 
 
OBAFGKM_RNS@yahoo.com
Guest
Posts: n/a
 
      07-03-2008
On Jul 2, 10:49 pm, (E-Mail Removed) wrote:
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
index of string from beginning of line vs beginning of file Jesse B. Ruby 9 03-27-2010 04:04 PM
Play wav or sound file. Cehotec - Tim Perl Misc 4 12-05-2007 04:11 PM
Substituting AOL Wav files with MSN Wav files Thaqalain Computer Support 6 07-07-2005 08:17 PM
WindowsXp ding.wav does not sound when releasing Play Control Slider in Volume Control FattyMcGee Computer Support 0 03-30-2005 10:12 AM
How to amplifi the sound of a low sound recorded wav file ? OCZ Guy DVD Video 4 07-03-2004 07:20 AM



Advertisments