Background sound for IE and FF

D

Dung Ping

I placed following code in a page to play background sound on IE and FF
respectively:

<bgsound
src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
loop='-1' />

<object>
<embed
src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
loop='5'></embed>
</object>

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.

http://www.pinyinology.com/music/meihua.html

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

cwdjrxyz

Dung said:
I placed following code in a page to play background sound on IE and FF
respectively:

<bgsound
src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
loop='-1' />

<object>
<embed
src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
loop='5'></embed>
</object>

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.

http://www.pinyinology.com/music/meihua.html

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

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

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

cwdjrxyz

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

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.

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
http://www.cwdjr.info/PlumsMarch/ . 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
IE6.

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

Dung Ping

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

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.

Following your proposal, I changed the code to following:

<embed
src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
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
 
C

cwdjrxyz

Dung said:
Following your proposal, I changed the code to following:

<embed
src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
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).

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

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

Dung Ping

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
http://www.cwdjr.info/PlumsMarch/ . 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
IE6.

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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top