Solved

How to play .WAV file with HTML?

Posted on 1998-11-15
10
3,919 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

863 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

21 Experts available now in Live!

Get 1:1 Help Now