473,387 Members | 1,624 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,387 software developers and data experts.

play .wav

Any body know of a javscript that will play a sound.wav file repeatedly onLoad?
Thanks in advance for your help.
Jul 20 '05 #1
4 11722
Nope, but then again .wav files are pretty much useless to people who
would rather use an efficiant OS rather than Windows. If you don't care
about compatability though (using wav files would seem to say that you
don't) IE added a bgsound attribute to the <body> tag. Just don't try
to validate your pages after using it.
Jul 20 '05 #2
"Josh Surber" <jo**@DELETE.THIS.TEXT.surber.us> schrieb im Newsbeitrag
news:170720030022046963%jo**@DELETE.THIS.TEXT.surb er.us...
Nope, but then again .wav files are pretty much useless to people who
would rather use an efficiant OS rather than Windows. If you don't care
about compatability though (using wav files would seem to say that you
don't) IE added a bgsound attribute to the <body> tag. Just don't try
to validate your pages after using it.


So what file format and embedding syntax do you suggest for playing sound in
a compatible and standards compliant way?

--
Markus
Jul 20 '05 #3
Markus Ernst wrote:

So what file format and embedding syntax do you suggest for playing sound in
a compatible and standards compliant way?


The following does the trick for playing mp3 files, I used it a lot but
in this case it has got nothing to do with JavaScript. This will work in
multiple browsers though I haven't tested it thoroughly, IE 5.5, IE 6.x,
Moz 1.x, Opera 6.x and Opera 7.x should work though.
Also this doesn't solve the problem in the first place, this won't cause
the file being played repeatedly.

<object id="music" data="music.mp3" type="audio/mpeg" style="heigth:0px;
width:0px"></object>

Jul 20 '05 #4
J K
Here's a non-standard html that I found several years ago. I believe it
works on either IE or Netscape. It has been sooo long ago that I do not
remember what it all means, but it does work. There is a loop parameter -
you'll have to look up the "bgsound" on one of the HTML sites for
discussion.

------html example 1----------

<embed src="closer1.mid" autostart=true hidden=false>
<noembed>
<bgsound src="closer1.mid" loop="1">
</noembed>

-----------end of example 1----------------

Any body know of a javscript that will play a sound.wav file
repeatedly onLoad? Thanks in advance for your help.


Jul 20 '05 #5

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

Similar topics

6
by: Andrew Poulos | last post by:
As a follow on to the 'fun' I had with IE I'm now trying to play sounds using an Object tag (no Embed) in MZ. Sadly whenever 'playButton' gets clicked MZ says that "audObj.Play is not a function":...
1
by: Ron Provost | last post by:
Hello, I'm developing a piece of software to assist illiteraate adults to learn to read. I'm trying to figure out how, if possible, to make audio playback asynchrnous but still controllable. ...
2
by: NB | last post by:
I've done a thorough search, but could not find any posts If I store a sound file within the mdb, How do I play it (in a form event, for example) I can save it to a temp folder and call the...
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"...
3
by: Jared | last post by:
I'm using the first code sample below to play WAV files stored as embedded resources. For some reason I *occasionally* get scratching and crackling. I'm using a couple WAVs that ship with...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
9
by: ZikO | last post by:
Hi. I'm struggle with playing a wav in Visual Basic. First I wanted to use My.Computer.Audio.Play() method but I realized it's not working if I want to have music in background. I found in...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
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...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.