|
Have you ever seen web pages
that play music while displayed in your browser? If so, have you
ever asked yourself how it's done? Well, let's find out what makes
such web pages tick.
There are many ways you can add sound to web pages, for instance,
you can use scripts or simple HTML to embed sounds on them, or you
could use helper applications such as Real
Player to accomplish the same effect. Let's take a look at simple
way to add/embed sound on a web page.
Below is the HTML you need to copy in the BODY of your document.
<EMBED SRC="your-sound-file.mid" AUTOSTART=FALSE LOOP=7 WIDTH=150
HEIGHT=50 ALIGN="CENTER"></EMBED>
EMBED alerts the browser that it needs to load a plug-in to play
the sound/music.
AUTOSTART allows you to decide whether you want the sound to
play automatically or not (in this case the viewer needs to start
the music). If you want the sound/music to start automatically
you have to set the following to AUTOSTART=TRUE.
LOOP if set to TRUE will play the sound/music forever, if set
to FALSE, the sound will only play once. In this case, LOOP is
set to 7 - which means that the sound/music will play seven times
and then stop.
WIDTH/HEIGHT/ALIGN allows you to control the plug-in's control
panel size (viewer will need this control panel to start the sound/music
if AUTOSTART is set to FALSE).
There are some disadvantages to embedding sound on web pages with
the command above, for instance, one has to wait for the entire
sound file (MIDI, WAV) to download before the sound can be heard,
also note that not all Browsers may recognize such command - the
command above will work on Netscape only, to make it work with IE
you need to add the following command: BGSOUND="your-sound-file.wav".
|