simultaneous sounds

J

Jimnbigd

I want to write a game, and sounds will really add to it. Note that I
would always make the sounds optional. I hate it when I go to a URL and
unexpectedly get sounds or music.

I have played with bgsound in IE, and found I can have simultaneous sounds
using multiple bgsound tags. I have done a google search, and the only
results I found were for "multiple sounds", and all of these really meant
"consecutive sounds" -- one sound following another. I could not find
anything that answered this when I searched for ("simultaneous sounds" or
"concurrent sounds") and ("javascript" or "html" or "bgsound").

My question: Do other browsers allow simultaneous sounds? I suspect not,
since I understand Netscape (and others?) use plug-ins, and I doubt the
plug-in can take more than one sound at a time. But maybe someone has found
a way???

Here is my URL for testing some simultaneous sounds, if you want to play
with it. It requires IE and uses bgsound:
http://home.comcast.net/~jimnbigd/losewin.html

Thanks...Jim...
 
D

DJ Craig

I'm not sure if they do, but you would probably be better to do that
with either Flash, Shockwave, or a java applet. The bgsound and embed
tags behave very differently in different browsers. ie in Windows XP
with IE 6, there is no way to have a sound clip only play through once;
it loops no matter what. On every older version of IE, and almost
every other browser, it has always worked.
 
J

Jimnbigd

DJ Craig said:
I'm not sure if they do, but you would probably be better to do that
with either Flash, Shockwave, or a java applet. The bgsound and embed
tags behave very differently in different browsers. ie in Windows XP
with IE 6, there is no way to have a sound clip only play through once;
it loops no matter what. On every older version of IE, and almost
every other browser, it has always worked.
But I'm using windows XP home edition and IE 6.0 on my home computer, and my
sounds do not loop.
....Jim...
 
R

Random

Jim,
I haven't had a problem with Firefox and simultaneous sounds. Remember
that IE is also using a plugin (Windows Media Player). Like you I had
to use multiple tags, but rather than using the <bgsound> tag, I used
<embed>.

Maybe that'll do what you need it to.

Hope it helps.
 
J

Jimnbigd

Random said:
Jim,
I haven't had a problem with Firefox and simultaneous sounds. Remember
that IE is also using a plugin (Windows Media Player). Like you I had
to use multiple tags, but rather than using the <bgsound> tag, I used
<embed>.

Maybe that'll do what you need it to.

Hope it helps.
Thanks. Yes, this helps. I was not aware that <bgsound> uses Windows
Media, but it makes sense. I wonder if Quicktime or Realplayer plugins will
do simultaneous sounds with multiple <embed> tags. I'll have to try it. By
the way, I know this is not directly javascript, but I use javascript to
control these sounds.

Question with embed: Does changing the src value for an <embed> tag play a
new sound (or even replay the same sound if the src is the same value)? I
know it does with <bgsound>.

Thanks...Jim...
 
R

Random

I really don't know if it autoplays a new sound, but changing the src
attribute will load a new sound, yes.

Generally, you can count on any given plugin implementing .play(),
..stop(), and so forth. In what I did, I didn't specify any specific
plugin requirement because I honestly just didn't feel like it, and I
haven't had any problems with cross-compatibility.

I used three <embed>s, the first having an intro sound, the next two
loading the same sound. Knowing the duration of the second clip, I
JavaScriptically looped them so that there's a slight bit of overlap.
It plays the first and, when that's almost done, plays the second. When
the second is almost done, it plays the first. In most cases it works
seamlessly.
 
T

Thomas 'PointedEars' Lahn

Jimnbigd said:
DJ Craig said:
I'm not sure if they do, but you would probably be better to do that
with either Flash, Shockwave, or a java applet. The bgsound and embed
tags behave very differently in different browsers. [...]

Of course, because there are no such things. There are `bgsound' and
`embed' _elements_ (with start tag, optional PCDATA content and end tag)
that are not part of Valid HTML. `object' elements are to be used instead,
however the API provided for HTMLObjectElement objects depends on the
plugin used for display.

Efforts to standardize that API among user agents and plugins are already
underway but did not yet result in a Web standard or any standards
compliant API implementation.


PointedEars
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top