RealNetworks pioneered streaming audio with RealAudio, the first streaming media product for the Internet. Since its debut in 1995, RealAudio has become the standard for network audio, delivering stereo sound over 28.8 Kbps modems and CD-quality sound at high connection speeds. This chapter gives pointers on how to prepare and encode your sound files for streaming.
Because RealAudio clips are compressed, you typically start with a sound file in a digitized, uncompressed format such as WAV or AIFF. Using a RealAudio encoding tool, you create a RealAudio clip from the source file. RealAudio clips use the file extension .rm, although older clips may use .ra instead. This section explains how RealAudio encodes an audio file for streaming. This knowledge will help you produce high-quality streaming clips.
One way that RealAudio squeezes an audio file's size down is by throwing out nonessential data. This makes it a lossy compression format. RealAudio doesn't delete data indiscriminately, though. It first jettisons portions you cannot hear, such as very high and very low frequencies. Next, it removes as much data as needed while keeping certain frequencies intact. Voice encoding favors frequencies in the normal human speaking range. Music encoding retains a broader frequency range.
Although RealAudio is savvy about what audio data it throws out, be aware that the lower the connection speed, the more data gets ejected, and the cruder the sound quality becomes. At low bandwidths, you get roughly the quality of an AM radio broadcast. With faster connections, you can encode music with FM-quality sound. And at the high speeds of DSL, cable modems, and LANs, RealAudio sound quality rivals that of CD playback. When creating RealAudio clips for low bandwidths, it's important to start with high-quality input, as described in "Capturing Audio", to attain good sound quality.
You create a RealAudio clip by using one or more RealAudio codecs. A codec is a coder/decoder. It tells an encoding tool how to turn audio source files into RealAudio clips. On the receiving end, RealPlayer uses codecs to expand clips into audio data the computer can play. RealAudio employs a series of codecs, each of which creates an audio stream for a precise bandwidth. One codec compresses mono music for a 28.8 Kbps modem. Another one compresses stereo music for that same modem speed. This set of codecs is different from the set used to compress music for, say, DSL and cable modem connections.
A RealAudio clip consumes bandwidth at a flat rate determined by the codec used to encode the clip. A RealAudio clip encoded with a 20 Kbps codec, for example, steadily consumes 20 Kbps of bandwidth as it plays. The following table lists the standard bit rates for RealAudio clips encoded for specific target audiences by RealProducer 8.5. Encoding a voice-only audio file for a 28.8 Kbps modem, for example, creates a 16 Kbps streaming clip. With mono music input, though, you get a 20 Kbps clip.
In terms of bandwidth use, RealAudio is the most
inflexible media type. The RealAudio codecs set streaming bit rates in a stairstep model: 20 Kbps, 36 Kbps, 44 Kbps, and so on, with no inbetween choices. Because RealAudio clips always stream at specific bit rates, consider their bandwidth needs first when you use them in multiclip presentations. Then create your other clips to stream within the bandwidth that's left.
![]() |
Note |
---|
With SureStream technology, a single RealAudio clip can stream at many different speed. For the basics of SureStream, see "SureStream RealAudio and RealVideo". |
This section discusses the RealAudio codecs used by RealProducer. The codecs are listed in separate tables for voice, mono music, and stereo music. Voice codecs focus on the standard frequency range of the human voice. Music codecs have broader frequency responses to capture more high and low frequencies. The tables list each codec's optimum sampling rate and frequency response.
Using a codec's optimum sampling rate in your audio source file ensures that the audio stays synchronized with other media in the presentation. It also prevents pitch shifting in audio resampling. Audio quality degrades if you use less than the optimum sampling rate. If you use a higher rate, it is best to use a multiple of the optimum rate. If the optimum rate is 8 kHz, for example, use a higher rate of 16 kHz or 32 kHz. When in doubt, use the CD-quality sampling rate of 44.1 kHz.
Each codec has a particular frequency response measured in kilohertz (kHz). A codec with a higher frequency response reproduces a wider range of sound than a codec with a lower response. A measure of codec quality, the frequency response does not affect how you produce audio source files. RealAudio encoding always results in a clip of equal or lower quality than the original audio source. If the original audio source has an 8 kHz frequency response, encoding it with a codec that has a frequency response of 10 kHz produces a clip that still has a response of 8 kHz.
Voice codecs are for voice-only clips. The lowest-speed voice codec normally used to encode a RealAudio clip streams data at 16 Kbps. The lower-speed codecs (5, 6.5, and 8.5 Kbps) are used as SureStream duress streams that RealPlayer downshifts to if the connection bandwidth drops. They're also used to encode soundtracks for low-bandwidth RealVideo clips.
As with the voice codecs, the lowest-speed mono music codec normally used with RealAudio streams data at 16 Kbps. The lower-speed codecs (6, 8, and 11 Kbps) are used as duress streams in SureStream clips, and to encode soundtracks for low-bandwidth RealVideo clips. When there are two versions of a codec, RealProducer uses the higher-response version by default.
RealPlayer G2 or later can play the stereo codecs listed in the following table. These stereo codecs do not stream slower than 20 Kbps because, if they did, they would not have enough frequency response for adequate sound.
RealAudio 8 introduces new stereo music codecs that greatly enhance sound quality, especially over high-speed connections. Only RealPlayer 8 and later can play RealAudio 8 clips. Users with RealPlayer G2 and RealPlayer 7 are prompted to upgrade to the latest version of RealPlayer before listening to a RealAudio 8 clip. When there are two versions of a codec, RealProducer uses the higher-response version by default. These codecs are also used to encode voice-with-music clips.
The following tables list older RealAudio codecs that became obsolete with RealSystem G2. Some of these codecs are still used for compatibility with RealPlayer 5, though. RealPlayer G2 and later can play any clips encoded with these codecs. An "X
" in the 5, 4, 3, 2, or 1 column indicates that a clip encoded with this codec can be played by that version of RealPlayer.
RealAudio Codec | 5 | 4 | 3 | 2 | 1 | Sampling Rate | Frequency Response |
---|---|---|---|---|---|---|---|
8 Kbps Voice | X |
X |
X |
X |
X |
8 kHz | 4 kHz |
15.2 Kbps Voice | X |
X |
X |
X |
|
8 kHz | 4 kHz |
To produce a great RealAudio clip, you need to use great source material, high-quality equipment, and good production practices. This section surveys the steps involved in streaming a RealAudio clip.
You start audio production by capturing audio from a source, such as a person speaking into a microphone. You might also start with an audio source file from a compact disc, for example.
![]() |
Additional Information |
---|
"Capturing Audio" provides guidelines for capturing audio. |
With the audio file digitized in a common file format such as WAV or AIFF, you can use a sound editor to optimize the audio file for encoding as a streaming clip. When broadcasting live, however, you encode audio input directly from the source, optimizing the audio during capture.
![]() |
Additional Information |
---|
See "Optimizing Audio" for tips on editing sound. For more information on live broadcasting, read Chapter 11. |
With your digitized file optimized or your live broadcast ready to go, you encode your source file in the RealAudio format. When you do this, you choose streaming bandwidths based on your target audiences.
![]() |
Additional Information |
---|
"Encoding RealAudio with RealProducer" provides encoding tips. |
When your presentation is ready to go, you make your RealAudio clip or broadcast available through your Web site. To combine a RealAudio clip with another streaming clip, such as a RealPix clip, you write a SMIL file.
![]() |
Additional Information |
---|
Chapter 6 explains SMIL. See Chapter 10 for instructions on linking your Web page to a clip or a SMIL file. |
A streaming clip reflects the quality of its audio source. Any quality problems within the source will affect the streaming clip as well. Because you cannot edit a broadcast, live Webcasting introduces several issues beyond those involved with delivering on-demand clips. This section will help you capture high-quality audio source files, or set up your sound equipment to deliver good broadcasts.
If you plan to stream existing material, start with the best source possible. Use the cleanest recording with the least amount of unwanted noise. Compact discs (CDs) and digital audio tapes (DATs) are good source media, although well-recorded analog sources such as records, reel-to-reel tapes, and chrome (type II) cassettes can sound just as good. Try to avoid consumer-grade recording media such as Type I cassettes and VHS tapes.
Every piece of equipment in the audio chainmicrophone, mixer, sound card, and so onaffects sound quality. If you intend to provide professional-quality audio content, invest in professional-quality audio equipment and software. Lesser equipment can add hiss and distortion, degrading sound clarity.
It is important to use high-quality, shielded cables. Using unshielded cables increases the likelihood of introducing line noise and radio frequency interference into recordings. Keep audio cables physically separated from power cords to minimize the introduction of noise. Also be sure to ground all equipment properly.
Setting correct input levels is crucial. All audio equipment has a signal-to-noise ratio, the ratio between the loudest possible sound the equipment can reproduce without distortion and its inherent "noise floor." Also called "clipping," distortion of this type is audible as a high-frequency crackling noise.
To get the best signal-to-noise ratio, set the input level on each audio device in the signal chain so that it uses its full range of available amplitude without distortion during the program's loudest sections. The signal chain typically includes a microphone, a mixing desk, a compressor, and a sound card. For each piece of equipment, set levels as close as possible to 0 decibels without going over that level.
Check for signal distortion at each point in the signal chain. Perform several test runs, and make sure that there are no peaks above maximum amplitude. Adjust the levels on your sound card mixer so that the input approaches but does not exceed the maximum. Be conservative, though. Levels might suddenly increase if, for instance, an interviewee suddenly speaks loudly or a crowd at a sports event roars.
When broadcasting live audio streams, it is useful to have a dynamics compressor for gain compression (not data compression). This piece of audio equipment automatically adjusts the volume level. By providing a consistent volume level, it allows you to "set and forget" the input levels to RealProducer.
Try to capture sound with a sampling width of 16 bits. RealAudio codecs have different sampling rates that produce the best sound, however. If your sound card allows it, capture audio content at the optimum sampling rate for the codec you intend to use. The RealAudio encoder will convert the file to the optimum rate if necessary, but this is recommended only for static files. For live broadcasts, use a sound card that supports the optimum rate. This avoids the overhead entailed in converting the rate while encoding sound in real time.
![]() |
Additional Information |
---|
"RealAudio Codecs" lists the optimum sampling rates for each codec. |
If you are not broadcasting audio live, you work with digitized audio source files in supported formats such as WAV or AIFF. You then edit the audio files to optimize them. To do this, you need to be familiar with the features your editing program offers. This section gives you some optimization tips you can try with your editing software.
![]() |
Tip |
---|
Always keep copies of your audio source files. You cannot convert RealAudio clips back to their original source formats. |
DC offset is low-frequency, inaudible noise that results from equipment grounding problems. If you don't remove it, it can skew the results of subsequent sound editing. Use your sound editor's DC Offset function immediately after recording a digital audio file.
![]() |
Tip |
---|
If your editing program has this option, remove DC offset during recording. This eliminates an editing step. |
Set sensible input levels when recording, and then use normalization to maximize the levels after recording. Your streaming files sound best when your digitized source has the highest possible gain without clipping. Digital audio files that do not use their full amplitude range produce low-quality streaming clips. If the amplitude range is too low, use your sound editor to adjust the range and increase the amplitude.
Normalization maximizes the volume level of the audio file's loudest sections. Consequently, quiet sections may not encode as well. Dynamics compression evens out input levels by attenuating (turning down) the input when it rises above a specified threshold. Check your audio software for a Compression or Dynamics feature. You can control attenuation by specifying a compression ratio. This turns down the loudest sections, and you can readjust input levels accordingly.
Equalization (EQ) changes the tone of the incoming signal by "boosting" (turning up) or "cutting" (turning down) certain frequencies. Using EQ, you can emphasize certain frequencies and cut others that contain noise or unwanted sound. EQ can compensate for RealAudio codecs that do not have flat frequency responses (that is, codecs for which certain frequencies are not as loud after encoding). You can therefore use EQ to make a RealAudio clip sound as close as possible to the source recording.
![]() |
Tip |
---|
For voice-only content, you can make the file more intelligible by cutting frequencies below 100 Hz and carefully boosting frequencies in the 1 to 4 kHz range. |
To produce RealAudio clips, you start with audio input from a live source, a digitized file, or media such as a tape or CD. You then encode a RealAudio clip from this input by using a RealAudio encoding tool. Some sound-editing programs can create RealAudio clips. But the most widely used tools for encoding RealAudio are RealProducer Basic (a free product) and RealProducer Plus, which are available from RealNetworks at:
http://www.realnetworks.com/products/producer/info.html
RealProducer on Macintosh accepts the formats widely used on that platform, whereas RealProducer on Windows and UNIX supports the formats widely used on those platforms. Check the RealProducer manual for your operating system for a list of accepted formats, which may include:
When you encode audio clips with RealProducer, you select the target audiences you want to reach, such as 28.8 Kbps modem users. You also indicate the audio type, whether voice or music. RealProducer then determines which RealAudio codecs are best to use. RealProducer uses SureStream technology to encode the RealAudio clip so that it streams well for all your bandwidth choices, requiring only a few seconds of preroll when RealPlayer users request the clip.
![]() |
Additional Information |
---|
Refer to the RealProducer user's guide or online help for step-by-step instructions for encoding RealAudio. A document explaining RealAudio codecs in-depth is at http://service.real.com/help/library/blueprints.html. |
![]() |
Note |
---|
RealAudio encoding tools other than RealProducer may not include all the features described in the following sections. |
If your RealAudio clip will be played along with another clip, you may need to change RealProducer's default codec selection by adjusting the RealAudio target audience settings. Encoding mono music for 28.8 Kbps modems usually entails a 20 Kbps codec, for example, leaving no bandwidth for the second clip. RealProducer has a set of multimedia defaults, though, that lower the clip's bandwidth. With these defaults turned on, RealProducer encodes the mono music clip at 8 Kbps, leaving 12 Kbps of bandwidth for the second clip.
RealProducer can include in SureStream clips a stream that RealPlayer 5 can play. This backward-compatible stream is at your lowest target bandwidth. For example, if your clip targets 28.8 Kbps modems, 56 Kbps modems, and DSL speeds, the RealPlayer 5 stream is for 28.8 Kbps modems. It uses an older RealAudio codec, and RealServer streams it to RealPlayer 5 using the older PNA protocol rather than the newer RTSP. RealPlayer 5 will receive this stream regardless of its connection speed.