A Complete Guide to Web Design

(やまだぃちぅ) #1
Streaming Audio 343

Audio

Streaming Audio

Web Design in a Nutshell, eMatter Edition

recent versions of both Netscape Navigator and Internet Explorer come with the
QuickTime Plug-in so QuickTime audio can be embedded right on the page.


The QuickTime player can begin playing the audio as the data is downloading.
However, because it is reading it from the user’s cache, it is only a partially
streaming media.


Many multimedia authoring tools support the QuickTime format and can be used
for converting audio files to the.movformat. MoviePlayer Pro 3.0 (part of the
QuickTime Pro 3.0 release) allows you to create, edit, and convert media files to
QuickTime format. The Qdesign audio codec (compression/decompression algo-
rithm) is recommended for audio files formatted for QuickTime 3.0 playback.


For more information on QuickTime, seehttp://www.apple.com/QuickTime.


Adding Streaming Audio to an HTML Document


As with static audio files, there are two methods for adding streaming audio to a
page—via a link or using antag. Using theoption will put the
controls for the streaming audio inline on the Web page. Embedding the controls
allows for the design of custom interfaces, but it should be noted that the audio
will stop playing when the user leaves the page.


Each technology’s plug-in has its own set of attributes that can be added to the


tag. We will look at the options for using thetag with Quick-
Time and RealAudio later in this chapter.

Linking to streaming audio


Some plug-ins require that links be made to special go-between files instead of to
the streaming audio file itself. These reference files (optionally) reside in the same
directories as the HTML documents. When they are accessed via a hyperlink, they
pass the URL of the actual media file to the appropriate plug-in, which in turn
requests the audio stream from the server.


For example, RealAudio’s reference files are called “metafiles” (suffix.ram). In
HTML, the link is made to the metafile (.ram), not the RealAudio file itself, as
follows:


<A HREF="song.ram">Link to the song</A>

The metafile contains the URL that points to the RealAudio file (suffix.ra):


pnm://[ip.address]/song.ra

It may also include an optional set of parameters for controlling starting, stopping,
and information about the audio file.


Metafiles are useful for maintenance and control purposes. To change the audio,
all you have to do is change the tiny metafile, rather than having to dig through
HTML source code. You can also do things like calling multiple streaming media
files from one metafile. One link to the metafile plays all the files.


Each streaming audio solution works differently, so refer to the documentation on
each vendor’s web site for specific instructions.

Free download pdf