Solved

How to play .WAV file with HTML?

Posted on 1998-11-15
10
3,917 Views
Last Modified: 2008-03-17
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.
0
Comment
Question by:st
10 Comments
 
LVL 4

Expert Comment

by:rafistern
ID: 1839691
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
 
LVL 4

Expert Comment

by:ruperts
ID: 1839692
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
 
LVL 1

Author Comment

by:st
ID: 1839693
ruperts, thanks but I don't want the .WAV file too large. Any other way?
0
 
LVL 12

Expert Comment

by:Otta
ID: 1839694
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
 
LVL 19

Expert Comment

by:cheekycj
ID: 1839695
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 12

Expert Comment

by:Otta
ID: 1839696
ST, my previous answer was correct -- and it works!
ST, please explain why you "rejected" that answer.
Thanks.
0
 
LVL 1

Author Comment

by:st
ID: 1839697
Otta: It is required a silence delay before the playing the .WAV file.
0
 
LVL 12

Expert Comment

by:Otta
ID: 1839698
Record some "delay" in the WAV (or AU) file.
0
 
LVL 1

Author Comment

by:st
ID: 1839699
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
 
LVL 12

Accepted Solution

by:
Otta earned 20 total points
ID: 1839700
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now