Intro/Why MP3?
A few years ago, if you wanted to provide your web audience with streaming audio on demand, the Real Audio format seemed the most practical method for doing so. The encoding process was simple, the format was both Mac and PC friendly, and, with the introduction of Surestream technology, users could access the audio appropriate for their connection speed without forcing Webmasters to create separate files for both dial-up and broadband modems.
Yet, as with most proprietary technology, to get the best of what Real Audio was designed for, you had to pay some real bucks. While you could get an encoder for free, to use Surestream you were required to either license or rent space on a Real Media (now called Helix) server. A free version of the server has been available for a while, but there is a limit on how many users you could accommodate at once. You also had to know how to install and maintain that server. Not exactly brain surgery, but still... Are we not partial to simplicity where we can find it?
If your needs (or means) are simple, streaming MP3 might be your best option.
Sample software:
Goldwave (Figure 24.3) - www.goldwave.com,
Adobe Audition - www.adobe.co.uk/products/audition/main.html
Sound Forge - mediasoftware.sonypictures.com.
Most recording software will allow you to choose the quality of your recording. You can usually choose between:
What is Streaming?
Streaming means that you don't have to download an entire file before you can listen to it - you listen to it AS it downloads and passes through your computer audio player. Another important feature of streaming media is that users are limited to listening to your audio only when they are online. The file is not saved to their hard drive where they can distribute and manipulate it any way they want. There are ways around these restrictions, but the user has to go to some extra effort to accomplish this. Remember, in reality, if you really want to copy audio off the web, just plug a mini-disc recorder into the sound card and press record.
You will need specialised software to edit and compress your captured video (see for example www.avid.com/freeDV/ )
Some leading media streaming server applications are:
The following list highlights some of the most popular formats:
| File format | Description |
|---|---|
| MPEG - filename.mpg | MPEG stands for Moving Picture Experts Group, and is the name of a family of standards used for encoding and compressing audio-visual data. There are currently four major MPEG standards (MPEG-1, MPEG-2, MPEG-4 and MPEG-7) which have been developed for various different types of multimedia delivery system. For example, MPEG-1 is commonly used for storage of video and audio on CD-ROM; MPEG-2 is used for DVDs, satellite, cable and other digital broadcasts, although MPEG-4 will soon be playing a greater role in this area. On the web, MPEG video files generally have the extension .mpg whilst MPEG Audio files generally have the extension .mp2, .mp3 or .m4a (see next item below). For more details about MPEG, see www.chiariglione.org/mpeg/index.htm |
| MP3 - filename.mp3 M4A - filename .m4a |
The MP3 file format has become extremely popular in recent years for Internet-based audio file distribution, because it allows near-CD quality sound to be compressed into a reasonably small file size. (Strictly speaking, the MP3 format is really just the audio "layer" (layer 3) of the MPEG-1 and MPEG-2 standards above.) MP3 format audio can also be streamed over the web (see Section 24.5 below) to provide high-quality "internet radio" - e.g. www.shoutcast.com A new standard format called M4A (MPEG-4 Audio layer) is intended as a replacement for MP3 format, containing various improvements - see www.m4a.com. |
| Real Audio & Real Video - filename.ram | Real Networks (www.real.com) have developed this proprietary commercial format for delivering streaming audio and video via the web. Several major sites have used Real technology to deliver clips of news footage or "internet radio" - see for example news.bbc.co.uk. Before you can play Real format files on your computer, you will need to download and install the Real Player, which is free for individual non-commercial use from www.realaudio.com. (Note that there is also a more sophisticated version of this software, which does require payment of a license fee, and is heavily promoted on the Real site - you will need to be persistent in order to locate the link to download the free version!) |
| QuickTime - filename.mov | Developed by Apple, QuickTime is a popular cross-platform multimedia architecture that can be used to deliver both sound and video. The QuickTime architecture forms the basis on which the MPEG-4 industry standard was developed. A modified form of QuickTime called QTVR enables the creation of 360-degree "virtual reality" panoramic images, which the user can navigate by using their mouse (Figure 24.2). QuickTime files require extra (free) viewer software to be installed before they can be played on a Windows or Linux computer. For more details, see www.apple.com/quicktime. |
| AVI - filename.avi | "Audio Video Interleave" - Developed by Microsoft, this is a very popular format particularly amongst PC users, but is beginning to be superseded by more modern Microsoft streaming formats (see the next two items below). |
| ASF - filename.asf | "Advanced Streaming Format" - a Windows format specially designed by Microsoft for web streaming - it can contain audio, video, or slide shows. |
| Windows Media Audio - filename.wma Windows Media Video - filename.wmv |
Compressed streaming formats designed by Microsoft for playback in Windows Media Player. (Note that Windows Media Player can be downloaded for various platforms, including Sun Solaris and Macintosh.) |
| WAV - filename.wav | A common sound file format, on all platforms. WAV files are not compressed, so their file sizes tend to be very large. They can be written directly onto audio CDs. |
| MIDI - filename.mid | Musical Instrument Digital Interface format, is an electronic digital music format, which can be produced by computers, electronic keyboards and synthesizers. Strictly speaking, it is a set of instructions to control the playback of music, from any compatible device. Most of the clips of annoying "background music" commonly used to enliven web pages are in MIDI format (they usually bear little resemblance to any conventional musical instrument, because most computers' sound cards have only a very limited set of responding "instruments"). |
| Ogg Vorbis - filename.ogg | An Open Source audio compression and streaming format that provides a better quality alternative to MP3. See www.vorbis.com. |
| AU - filename.au | Sun Audio format, originally designed for use on UNIX systems |
| Flash - filename.swf and filename.flv | Macromedia's Flash format has recently improved its support for audio and video (in Flash MX 2004). Clips in many of the formats above can now easily be embedded into Flash movies, and exported in the Flash (SWF) format, or as a Flash Video (FLV) file. The free Flash Player 6 plug-in is required in order to view such Flash-based content - although this is currently the most widely distributed player of any media type. See: www.macromedia.com/devnet/mx/flash/video.html |
The simplest way of making an audio or video file available on the web is to provide a simple link to it:
<a href="filename.mp3">Hear a sound sample (250kb MP3 file) </a>
<a href="filename.mov">Play movie clip (700kb QuickTime movie) </a>
It is good practice to indicate the size of the file to be downloaded (so that users on slow modem connections are forewarned!).
Alternatively, you may wish to embed an audio or video player directly into your web page. This has the advantage that the user can control the playback of the file from controls which are actually a part of the displayed page itself (see Figure 24.1). This can help to create a consistent and unified experience for the user (rather than requiring them to switch back and forth between a separate player application and the web browser).
Embedding a player into a web page can be a complex undertaking, particularly if you wish to support a range of different browsers. Until recently, the most common method of embedding a media player into a web page was to use the <embed> tag:
<embed type="video/quicktime" width=320 height=240 src="video.mov" autoplay="true" controller="true" loop="false" pluginspage="http://www.apple.com/quicktime/download/"></embed>
The autoplay attribute may be set to true or false, depending on whether you want the media file to start playing automatically when the page is downloaded. Similarly, the controller attribute specifies whether to hide or to show the panel of controls (Figure 24.1). The loop attribute determines whether playback should stop at the end of the file, or alternatively whether the file should be played over and over again. The pluginspage attribute supplies the URL from which a user may download the appropriate player software for this file.
However, the preferred modern method of embedding media into a web page (as recommended by the W3C) is to use the rather more complex <object> tag:
<object id="quicktimeplayer" width="320" height="240" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="video.mov" />
<param name="controller" value="true" />
<param name="autoplay" value="true" />
<embed src="video.mov" width="320" height="240" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/">
</embed>
</object>
Example - XHTML code used to embed a QuickTime movie inside a web page