play .wav

T

Todd Anderson

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

Josh Surber

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.
 
M

Markus Ernst

Josh Surber said:
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?
 
P

Prodoc

Markus said:
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>
 
J

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----------------
 

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

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top