By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,668 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

play .wav

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.