Solved

How to play .WAV file with HTML?

Posted on 1998-11-15
10
3,927 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 65
Joomla 2.5 shopping cart 7 30
CSS: How to get responsive tables to not be so spread out on desktop 5 41
If condition on Html with Asp 11 27
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

856 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