Background sound for IE and FF

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I placed following code in a page to play background sound on IE and FF

src=' '
loop='-1' />

src=' '

However, when opened online with IE, there are double sounds, sounding
that both pieces of code are working one after the other, with fraction
of a second in between.  But opened offline, there are no double
sounds.  Nor opened with FF.

Following is the page.  But the song is in Chinese.  It may not be easy
to detect the double sounds without some knowledge about the language.

Is there any problem with the code?  Expertise is greatly appreciated.
Dung Ping

Re: Background sound for IE and FF

Dung Ping wrote:
Quoted text here. Click to load it

The problem with the code is that both bgsound and embed are hangovers
from the browser war era, and neither have ever been part of official
W3C html. Adding an object around embed does not make the code correct.
There are ways to handle the code correctly for modern html and media
players, but they can be a bit complicated.

The bgsound tag is an IE(and close relatives) thing only, and would not
work on old Netscape or on the new Mozilla family browsers including
Firefox, Mozilla, and Netscape.   An exception is that Opera may handle
bgsound, as it does many other Microsoft things, but I am not certain
about this.

The embed tag(skip the object around it, and it does not need to be
closed) worked on the old Netscape. Early on it would not work on IE,
but at some point Microsoft added embed support for their browsers, so
today IE usually supports embed. Thus on Microsoft you likely have two
players working that are playing the same song with slightly different
start times. If you remove the bgsound code, operation likely will be

I did not hear the song on my Firefox, but the problem was not the
code. Rather I just do not have a plugin assigned to play the .au
soundfile you use, so Firefox complained about that.. The .au sound
file is not used much anymore, so you may find a few others who do not
have a plugin set up for it on some or all of their browsers.

Re: Background sound for IE and FF wrote:
Quoted text here. Click to load it

It is easy to convert the Sun .au format to a .wma format using the
free Windows Media Encoder. It also is easy to convert the .au to a
Real .rm sound file. These are the two formats most often used to
stream audio on the web today. You have to write a .ram redirector file
to connect to the .rm for streaming, and you write a .wax redirector
file to connect to the .wma to make it stream. Please see . Here you will find the sound and
redirector files that I mentioned as well as text versions of the
redirector files. Notice that if you click on the .wax redirector file
you bring up the big WMP player, and streaming starts. If you click on
the .ram redirector file, this brings up the Real player and streaming
starts. You can also embed the players on a page in many different
ways. Click on the WMP embed link to see one way this can be done. The
mime file on the page is an include and does nothing by itself - it
must link to a web page to work.

If you try to click it on, you will either get no display or you will
get an XML error message from browsers that can handle the mime type
application/xhtml+xml. I am using a php include to serve the page as
true xhtml 1.1 when the browser will accept the mentioned mime type and
as html 4.01 strict when the mime type is not supported, such as for

You are welcome to copy any of the files in this directory if you think
they might be of use.  I will take this directory down in a few days,
because I do not host streaming media files for others, since they can
use up quite a bit of bandwidth.

Re: Background sound for IE and FF wrote:
Quoted text here. Click to load it

I've saved some of the files, please have them removed as needed.  On
the other hand, I need more time to learn the skills.

Thanks for help.
Dung Ping

Re: Background sound for IE and FF wrote:
Quoted text here. Click to load it

Following your proposal, I changed the code to following:

src=' '
loop='true' hidden='true' autostart='true'></embed>

It works well on both IE and FF.  I put a </embed> tag at the end, but
understand it is not necessary.  I wonder that since each opening tag
needs to be corresponded by a closing one or close itself by </>, why
is <embed> an exception, that is, no closing tag or self-closing slash
is needed?

I've also read your next posting, but would like to read and test more,
as there are quite a few embed tags to play remote au files in my web
site.  Will post results this evening (U.S. east time).

Thank you very much for your help.
Dung Ping

Re: Background sound for IE and FF

Dung Ping wrote:

Quoted text here. Click to load it

Since the embed is not part of any official W3C version of html, there
can be no official rules for using it. It seems to work either with or
without a closing tag, when it works at all. Remember  that some tags
such as img and br are not followed by a closing tag even in html 4.01.
Everything must be closed in xhtml, but for some tags such as img and
br that are not closed in html 4.01, they are closed in a special way
such as <br />. But if you use embed at all in either html 4.01 or any
version of xhtml, the code will never validate at the W3C validator,
because embed is not an accepted tag in modern html. The object tag,
used in a rather different way from how the embed tag was used by old
Netscape, now is used to embed things in modern code.Old code before
W3C html 4 that used the old Netscape embed tag usually did not close
the embed. Much media code developed on IE now uses an ActiveX object
to embed media. However not all browsers support ActiveX, and some have
it turned off. Media code can be written using an ordinary object that
supports most recent browsers without using either ActiveX or invalid
embed for browsers thst do not support ActiveX.Unfortunately even many
large companies still write invalid media code that includes both an
ActiveX and invalid embed path for browsers that do not support

If you were to decide to use the WMP or Real audio formats, as I
mentioned, the free Windows Media Encoder that can be downloaded at
Microsoft will convert your other .au files to .wma. Also the free Real
Producer Basic 10 that can be downloaded at real will convert your .au
files to Real .rm audio files.

Site Timeline