Web designers may prefer to design their own console
using the button elements from the standard console. To do this, a designer
would have to place several EMBED
s on a page, and all of these EMBED
s would
control the same sound.
Let's assume that a designer wants to create a page with seperate Play,
Pause, Stop, and Volume controls. In this case, the designer would need four seperate EMBED
s in the HTML, all controlling the same sound
file.
To do this, a designer wouldn't want to load the same sound four times (which would necessitate considerable additional download time for users), so LiveAudio is designed to accept and ignore "sound stubs." Sound stubs are files that are of negligible length (0K to 1K), and have a generic name like stub1.wav.
You can create a stub on the Windows platform by following these steps:
To create a page with four LiveAudio elements (Play, Pause, Stop, and Volume) all
controlling the same file, a designer will need to create three sound stubs and
of course have one legitimate sound file (for a total of four EMBED
s).
Let's name these stub files stub1.wav, stub2.wav, and stub3.wav.
Assume that the legitimate sound file is called mysound.wav. To create a page
that has the four EMBED
s all controlling one sound, you should phrase your HTML
like this:
<HTML><HEAD></HEAD> <BODY> <EMBED CONTROLS=PLAYBUTTON HEIGHT=22 WIDTH=37 SRC="mysound.wav" MASTERSOUND NAME=LiveAudioGroup1> <EMBED CONTROLS=PAUSEBUTTON HEIGHT=22 WIDTH=37 SRC="stub1.wav" NAME=LiveAudioGroup1> <EMBED CONTROLS=STOPBUTTON HEIGHT=22 WIDTH=37 SRC="stub2.wav" NAME=LiveAudioGroup1> <EMBED CONTROLS=VOLUMELEVER HEIGHT=20 WIDTH=74 SRC="stub3.wav" NAME=LiveAudioGroup1> </BODY></HTML>In the above example, the
MASTERSOUND
attribute (in the first EMBED
ded element)
tells LiveAudio which sound file is legitimate and which sound file it should
ignore (because they are sound stubs).
Anytime you use the NAME
attribute in a LiveAudio <EMBED
>, you must also use a MASTERSOUND
attribute. LiveAudio will play no sound when a name attribute exists without a corresponding MASTERSOUND
attribute, even if that is the only EMBED
with that name on the page.
The NAME
attribute in the above example does two things: It logically
groups the EMBED
s into one console, and it gives Navigator a
named reference to the EMBED
group (for use later in JavaScript with
LiveConnect).
You can add many other items to an EMBED
tag to enhance
LiveAudio's performance. These tags include VOLUME
, LOOP
, and HIDDEN
.
The VOLUME
attribute is used to set the initial volume of a sound file (as a
percentage from 0 to 100). For example, to start a sound with an initial volume of
65 percent, you would use the following EMBED
.
<EMBED SRC="mysound.aif" HEIGHT=60 WIDTH=144 VOLUME=65%>The
LOOP
attribute controls how many times a sound is heard once it is loaded
onto a Web page. You can loop a defined number of times (i.e., one or two times), or
you can loop continuously. To loop a particular sound file
"forever," use the following example. (In reality, you can loop a sound file only as long as the page on
which the sound is EMBED
ded exists. When a user moves onto another page or when the
sound-EMBED
ded page is destroyed, the sound and sound controller is also
destroyed.)
<EMBED SRC="mysound.aif" HEIGHT=60 WIDTH=144 LOOP=TRUE>Or, to
LOOP
a sound file six times:
<EMBED SRC="mysound.aif" HEIGHT=60 WIDTH=144 LOOP=6>You can also have a "hidden" sound file on a page.
HIDDEN
LiveAudio EMBED
s loads
and plays, but does not have a graphically EMBED
ded console for a Web user to
control. This attribute can be useful for creating a background sound for a Web
page (or a Web site). To create a sound file and have it play in HIDDEN
mode,
try the following:
<EMBED SRC="mysound.aif" HIDDEN=TRUE>Notice that the above example does not have any
HEIGHT
or WIDTH
information, nor
does it include any extra parameters such as LOOP
or VOLUME
. You can, of course,
loop and set volumes for HIDDEN
sound files, but the above example illustrates
the simplest possible HIDDEN
sound EMBED
. HEIGHT
and WIDTH
parameters are
redundant and are not necessary when a HIDDEN
plug-in is used.
Corporate Sales: 415/937-2555; Personal Sales: 415/937-3777; Federal Sales: 415/937-3678
Copyright © 1996 Netscape Communications
Corporation
If you have any questions, please visit Customer Service.