How to play .WAV file with HTML?

I want to make a HTML which play a .WAV file.

However, the .WAV was required to play when the HTML was opened for a while (about 30 seconds), not immediately. After another 30 seconds, it will play again.

Is is possible to write a HTML like this?

Thanks a lots.
LVL 1
stAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
OttaConnect With a Mentor Commented:
Check "Luna's Hints - Eine Kleine Web Musik (A Little Web Music)", at:
http://www.sailormoon.org/luna/hint8.html

for details about <EMBED>.

The page at: http://www.auditorial.com/create/15.html
includes the information:

latency -- Specifies how many seconds of the streaming audio file to buffer before play begins.

So, if you specify a large latency, then there will be a dealy
before the sounds can be heard.
0
 
rafisternCommented:
This is not an easy thing to do as the javascript functions that do this are plugin specific. Take a look at my question on this subject:
http://www.experts-exchange.com/topics/comp/lang/javascript/Q.10096903

It all depends in the end which default wav player you have.
0
 
rupertsCommented:
One way would be to record a 1 minute long wav file, then just make it repeat!

<head>
<title>New Page 2</title>
<bgsound src="sound.wav" loop="-1">
</head>

Or to make it loop just twice change "-1" to "2"

If you want javascript it will only work on Netscape, IE4+ with the right plug - in.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
stAuthor Commented:
ruperts, thanks but I don't want the .WAV file too large. Any other way?
0
 
OttaCommented:
Yes, it is possible.

For an example, see the web-page for the sci-fi movie 'Contact'
(starring Jodie Foster), at:
http://www.contact-themovie.com/sound.html

which contains the HTML:

<EMBED SRC="message.au" WIDTH="2" HEIGHT="2"
AUTOSTART="true" HIDDEN="true" LOOP="true" VOLUME="77">


0
 
cheekycjCommented:
like  rafistern said you will need to use JS.

you will probably need to execute a function that plays it on a using the
js time delay function.

CJ
0
 
OttaCommented:
ST, my previous answer was correct -- and it works!
ST, please explain why you "rejected" that answer.
Thanks.
0
 
stAuthor Commented:
Otta: It is required a silence delay before the playing the .WAV file.
0
 
OttaCommented:
Record some "delay" in the WAV (or AU) file.
0
 
stAuthor Commented:
otta, I wanted to use this method before I post this question. I wanted make this with HTML only, because I don't want to make change to my .wav fileS. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.