473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Have a sound wav play from the beginning every time?

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">
Jul 3 '08 #1
1 2322
On Jul 2, 10:49 pm, OBAFGKM_...@yahoo.com 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.
Jul 3 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Askari | last post by:
Hi, I search how do for play more that one sound in same time with Python. Actually, I use the module "winsound" and I can play/stop a sound but can't play more that one sound in same time. :-( ...
1
by: jmdeschamps | last post by:
I'm trying to play programmed music by iteratively applying filter changes to a playing Sound object. It almost seem to work but i can't control duration of sounds??? Using tkSnack 2.2.4 for...
5
by: Chris | last post by:
I want a program that can "draw" sound. Imagine drawing a graph of frequency against time - and then being able to play it over the computer speakers. Can this be done in Python? As a...
4
by: Robert Gravereaux | last post by:
I'm putting together a C# .Net forms project on win2k. The application requires some sort of horn sound. I've never implemented any audio in .Net, so I'm not sure how best to accomplish this. ...
1
by: Lam | last post by:
how can I play sound file in a .aspx page written in C#? I try to use the code like the following. But whenI call the play function play("sound.wav", this.SND_ASYNC) my computer give out "be"...
10
by: CM | last post by:
Hi, I used to use the following code to play sound in VB6: Public Declare Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _ (ByVal lpszSoundName As String, ByVal uFlags As...
5
by: | last post by:
Hello, I am wrtting a program that does some sound effects... the files are stored in a subfolder in the application folder... and I check the existence of the files before calling the method to...
0
by: Sheena777 | last post by:
I would like to be able to play a sound with vb.net that will be played every time an accepted and reject event is called. The whole point to this is it will be to notify the user everytime the...
26
by: Jake Barnes | last post by:
I did a search on the newsgroup comp.lang.javascript. I was searching for "how to play a sound with Javascript". I'm somewhat suprised that the majority of entries are from the 1990s, and there are...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.