Sound is one of the parts of the
web that is still not even
close to being standardized. There are dozens of formats, and more coming all the
time. One of the popular things now is "Streaming audio" which starts playing the
sound file as it is still being downloaded, or a special connection sends
information to the player without ever actually sending the sound file. Usually
requires a plug in or even
special software to set things up. Examples are Real
Audio/Video, Quicktime 3.0, Shockwave among others.
Nonstreaming audio is a bit easier
to set up on your web page, though you still have to be careful as different
browsers, operating systems support different types of sound files. There are a few
links to supposedly "copyright free" sounds, but beware. TV shows, movies etc are
defending their copyrights on the internet quite vigorously. Also note, sound, like
anything else on a web page, should serve a purpose, so don't put in a 2 minute real
audio file saying "welcome to my webpage", unless you want to be immortalized at Web Pages That Suck.
Ok, you've read the stuff above,
and you want to know, "HOW DO I PUT THE SOUND ON THE PAGE, DARN IT".
The best way, that should insure it working on the greatest number of browsers is to
use the <embed> tag.
Assuming that the mozart midi file (a computer generated sound file) started playing
when you opened the page, the code for that was
<embed src="internet/mozart.mid" hidden=true autostart=true
NOTE: If you use hidden=true and autostart=true it's basically the same as
<bgsound> that is only supported in Internet Explorer. To use that, you would
- hidden=true - prevents the small "console" from showing up.
- autostart=true/false - True it starts on loading the page, False, you have to
click 'play' first.
- loop=true/false/number - True, plays constantly, false plays 1 time, number plays
that number of times
<bgsound src="mozart.mid" Loop=3 >
Additionally, you can just have direct links to a sound, which is no different than a
link to another web page, a picture, whatever. This is a nice option, because the
user can always save the file for later if his browser doesn't support that sound
format. Try these two out for size.
Just a few links so far