340 Chapter 19 – Audio on the Web
Nonstreaming (Static) Audio
Web Design in a Nutshell, eMatter Edition
align=left|right
hspace=number
vspace=number
These attributes allow the console to be positioned against the left or right
margin (with horizontal and vertical gutter space) and allows text to wrap
around it. These work the same as within the<img> tag.
starttime=minutes:seconds
Supported only by Mac, Windows 95, and NT.Specifies at what point in the
audio file the playback should begin.
endtime=minutes:seconds
Supported only by Mac, Windows 95 and NT.Specifies at what point in the
audio file the playback should end. Minutes and seconds are indicated with
two digits (e.g., 02:15 for 2 minutes, 15 seconds).
mastersound
Indicates which<embed>element contains the link to the audio file. Required
when grouping audio controls (using the NAME attribute).
NAME=text
This is used to group individual controls for use with a single audio file.
Background sound
There are several ways (mostly browser-specific) to make an audio file start
playing automatically when a web page loads. Note that the disadvantage of using
background sounds is that the user has no way of turning the sound off if she
does not like it. Also, if it is a large file, you are forcing a potentially lengthy
download on the user.
- For Internet Explorer 2.0+ (no other browsers support this tag) use the
tag, as follows:
wheresrcgives the URL for the audio file andloopis the number of times
you want the audio to play (this attribute can be set to “infinite”). WAVE,
AIFF, and MIDI sound files can be played as background sounds using this
method.
- To set a background sound that will work with both Netscape Navigator and
Internet Explorer, use a combination of the background sound tag and an - For Netscape Navigator and later versions of MSIE, you can make audio play
automatically with client-pull by using the tag as follows:
which causes the page to refresh (and the audio to play) after 1 second.