previous next

Working with RealAudio Codecs

All streaming audio and video clips use some type of codec, which is short for "coder/decoder." Codec software tells a computer how to compress or decompress a clip. RealProducer uses RealAudio and RealVideo codecs to convert audio and video input to RealAudio and RealVideo clips that stream at a certain bandwidth. On the receiving end, RealPlayer uses the same codecs to expand the streaming clips into digitized audio and video data that the computer can play.

RealAudio employs a series of codecs, each of which uses a precise amount of bandwidth when a clip streams. One RealAudio codec compresses mono music for a 28.8 Kbps modem. Another compresses stereo music for that same modem speed. This set of codecs is different from the set used to compress music for, say, cable modems. "RealAudio Codec Reference" lists the many RealAudio codecs RealProducer uses.

When you encode RealAudio with RealProducer, you select target audience speeds and indicate the audio type, whether voice, voice with music, mono music, or stereo music. By doing this, you tell RealProducer which RealAudio codec or codecs to use. That's why you need to answer RealProducer's questions correctly. Encoding with the wrong codec may degrade a clip's sound quality. Using a codec intended for voice on a music clip forces, as it were, a square peg through a round hole.

RealAudio squeezes files down by, in part, throwing out data, which makes RealAudio a lossy compression format. RealAudio doesn't delete data indiscriminately, though. It first jettisons portions you can't hear, such as very high and very low frequencies. Next, it removes as much data as needed while keeping certain frequencies intact. Your answer to the audio type question (voice, music, or a combination) determines which frequencies stay and which go. Voice encoding favors frequencies in the normal human speaking range. Music encoding retains a broader frequency range.

Although RealProducer is savvy about what audio data it throws out, you can't escape the reality 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 rivals CD playback.

Encoding with the RealAudio Standard Defaults

Out of the box, RealProducer is set up to use a specific set of RealAudio codecs based on your choice of:

Table 2 shows the bit rates at which RealProducer encodes a RealAudio file based on your choice of connection speed and audio type. With voice-only clips encoded for a 28.8 Kbps modem, for example, you get a 16 Kbps streaming clip. With mono music, though, you get a 20 Kbps streaming clip.

Table 2: RealAudio Standard Default Bit Rates
Target Audience Voice Only Voice and Music Mono
Music
Stereo
Music
28.8 Kbps modem 16 Kbps 16 Kbps 20 Kbps 20 Kbps
56 Kbps modem 32 Kbps 32 Kbps 32 Kbps
64 Kbps single ISDN 32 Kbps 44 Kbps 44 Kbps
112 Kbps dual ISDN 64 Kbps 64 Kbps 64 Kbps 64 Kbps
Corporate LAN 96 Kbps
256 Kbps DSL/cable modem
384 Kbps DSL/cable modem
512 Kbps DSL/cable modem

Notice that RealAudio doesn't use all of a connection's available bandwidth. For 28.8 Kbps modems, RealAudio uses 16 or 20 Kbps, reserving some bandwidth for network overhead. You can never push a full 28.8 Kbps of usable data through a 28.8 Kbps modem. Although the same is true for all connections, higher-speed connections need proportionally less bandwidth for overhead than analog modems, which are more prone to transmission errors.

At low speeds, RealAudio uses most of the connection bandwidth to make the audio quality as high as possible. At faster speeds, RealAudio uses less of the connection's total bandwidth. The fastest RealAudio codec is 96 Kbps, which is less than half the usable bandwidth of a 256 Kbps connection. Note, too, that every RealAudio codec has a specific speed. There are 64 Kbps and 96 Kbps codecs, for example, but nothing in-between. These are the factory settings, and you can't make RealAudio stream at, say, 75 Kbps.

Choosing SureStream Rates with RealProducer Basic

Getting a handle on the RealAudio codecs used with RealProducer's target audience speeds helps you use SureStream effectively. If you use RealProducer Basic, you get just two audience choices, so you should make the most of them. Table 2 tells you not to choose the 28.8 and 56 Kbps modem audiences when encoding a voice-only clip, for instance. If you do, RealProducer creates a single 16 Kbps stream for both audiences. It's better to choose one of the modem settings (it doesn't matter which) and one of the higher bandwidth settings. This gives you a clip with a 16 Kbps stream for slower connections, and a 32 or 64 Kbps stream for faster connections.

With music, though, you need to determine which audiences to leave out. For mono music, a 28.8 Kbps modem gets 20 Kbps of sound, while a 56 Kbps modem gets 32 Kbps. That extra 12 Kbps of bandwidth noticeably improves sound quality. So if modem audiences are important, encode with the two modem settings. If you want to provide higher-quality clips for faster connections, choose one modem audience to get a slower clip (16, 20, or 32 Kbps), and a higher-speed connection to get a faster clip (44, 64, or 96 Kbps). Just remember not to choose two audiences that get the same stream.

Choosing SureStream Rates with RealProducer Plus

If you purchase RealProducer Plus, you can encode RealAudio for all eight target audience speeds. It doesn't hurt to choose all the audiences, but you won't ever get eight distinct and separate streams. As shown in Table 2 above, many target audiences share the same stream. RealProducer is smart enough to know that if you choose different audiences that use the same codec, you need just one stream that uses that codec. It won't waste file space and processor time by stuffing two identical streams into the same clip.

In Table 2, notice that RealProducer Plus gives you, at most, five SureStream streams per RealAudio clip. Aren't you're supposed to get up to eight? This isn't a marketing ploy, as you'll see with RealVideo, which differs greatly in encoding speed for each target audience. And as described in "Changing RealAudio Defaults", you can modify the RealAudio default settings to get different streaming rates for each target audience.

Reducing Streaming Clip Size

Just because RealProducer Plus lets you encode for all eight target audiences, that doesn't mean you have to. Other factors such as clip size might matter. Each SureStream stream increases the clip's size as shown in Table 1. If the audio file is large, the encoded clip size can escalate dramatically. The bigger the clip, the more hard disk space it eats up, and the longer it takes to transfer to RealServer. If you need to reduce the clip size, Table 2 helps you intelligently select which connection speeds to leave out.

Suppose you're encoding stereo music. You want to cut down the file size, and the music quality is fine at medium bandwidths. Table 2 tells you to leave out the LAN and DSL/cable modem options. Just leaving out one of these options won't help because they all use a 96 Kbps stream. Leaving them all out eliminates the 96 Kbps stream, reducing the clip size quite a bit. Users with these fast connections get the 64 Kbps stream, which still has good quality. If clip quality is all important, though, you may want to keep the 96 Kbps stream to wring out as much fidelity as you can get.

Of course, you don't have to eliminate the higher bit rate stream. In some cases, you may want to eliminate an intermediate stream. Take a look at the "voice and music" column of Table 2. To cut down the clip size, you might leave out the 56 Kbps modem and 64 Kbps single ISDN audiences. Users at these speeds would then get the 16 Kbps clip, the same one 28.8 Kbps modem users get. The clip would have a 16 Kbps and a 64 Kbps stream for higher speeds. As you see, reducing SureStream file size is a balancing act based on which audiences are important to you.

Encoding with the RealAudio Multimedia Defaults

Table 2 shows you which RealAudio codecs RealProducer uses as its standard default settings. RealProducer has another set of defaults, though, that lower a RealAudio clip's streaming bandwidth so you can combine it with other clips in a multimedia presentation. To use the multimedia defaults, choose the menu command Options>Target Audience Settings>for RealAudio Clips.... This displays the dialog shown in Figure 2.

Figure 2: RealAudio Target Audience Dialog

Initially, the radio button Audio Only is selected. This sets RealProducer to use RealAudio's standard defaults given in Table 2. If you click Multimedia Presentation, RealProducer uses lower-bandwidth RealAudio codecs for each combination of audience and music type. This keeps RealAudio from overloading the connection when played in parallel with another clip in a SMIL presentation. These settings stay in effect until you click the Audio Only button to return RealProducer to the standard defaults.

Table 3 shows the results of encoding a RealAudio clip with the multimedia defaults. With these defaults turned on, encoding voice-only audio for a 28.8 Kbps modem produces an 8.5 Kbps clip, for example. The standard default given in Table 2 is a 16 Kbps clip. In most cases, a clip using the multimedia defaults consumes about half the standard default bandwidth. The "Top Speed" column in Table 3 shows the total usable bandwidth for each connection. Your multimedia presentation should not exceed this number.

Table 3: RealAudio Multimedia Default Bit Rates
Target Audience Top Speed Voice Only Voice and
Music
Mono
Music
Stereo
Music
28.8 Kbps modem 20 Kbps 8.5 Kbps 8.5 Kbps 8 Kbps 8 Kbps
56 Kbps modem 34 Kbps 16 Kbps 16 Kbps 20 Kbps 20 Kbps
64 Kbps single ISDN 45 Kbps 32 Kbps 32 Kbps 32 Kbps
112 Kbps dual ISDN 80 Kbps 32 Kbps
Corporate LAN 150 Kbps
256 Kbps DSL/cable 225 Kbps 64 Kbps 64 Kbps
384 Kbps DSL/cable 350 Kbps 96 Kbps
512 Kbps DSL/cable 450 Kbps

Tip
When you use RealProducer Basic, the same audience choice strategies discussed in "Choosing SureStream Rates with RealProducer Basic" apply to using the multimedia defaults.

When to Use the Multimedia Defaults

Using the multimedia defaults is crucial for delivering multliclip presentations at slow connection speeds. Suppose you want to deliver a combined RealPix slideshow and RealAudio narration over a 28.8 Kbps modem. For this modem speed, presentations should not exceed 20 Kbps. If you use the standard RealAudio settings, you get a 16 Kbps RealAudio clip, leaving just 4 Kbps for RealPix. That's inadequate for most slideshows. If you use the RealAudio multimedia settings, though, you get an 8.5 Kbps clip. That nearly triples the amount of bandwidth for RealPix to 11.5 Kbps.

At faster speeds, though, it's not always necessary to encode RealAudio at the multimedia rate for a multiclip presentation. Just make sure your RealAudio clip uses a lot of SureStream streams, and let each RealPlayer determine which stream to play. When clips play together, RealPlayer evaluates their separate requirements, assesses its own connection speed, and determines if it can juggle all the clips together. With a SureStream clip, RealPlayer automatically picks the highest bit rate stream it can handle while still keeping all the other balls in the air.

For example, suppose you have a RealPix clip at 12 Kbps. You could have it play in parallel with a RealAudio mono music clip encoded with the standard defaults for 28.8 Kbps and 56 Kbps modems. Table 2 shows that you get two audio streams, one at 20 Kbps and one at 32 Kbps. The combined RealPix and RealAudio presentation is too fast for a 28 Kbps modem. For a 56 Kbps modem, though, RealPlayer chooses the 20 Kbps RealAudio stream, putting the presentation at 32 Kbps (20 Kbps for RealAudio plus 12 Kbps for RealPix). Faster connections get the 32 Kbps RealAudio stream.

In some cases the multimedia defaults are the same as the standard defaults, so it doesn't matter which set of defaults you use. For DSL/cable modem connections, for example, mono music is recorded at 64 Kbps regardless of which defaults you use. The same is not true for stereo music with the 256 Kbps DSL/cable modem audience, though. The standard default is 96 Kbps while the multimedia default is 64 Kbps.

Even when the rates differ between the standard and multimedia defaults, you may want to stick with the standard defaults when you have bandwidth to burn. Look at the voice-only speeds for the DSL/cable modem settings, for instance. The multimedia rates are 32 Kbps, while the standard rates are 64 Kbps. But the presentation top speed is a whopping 225 to 450 Kbps. When pairing RealAudio with a RealPix clip that streams at 40 Kbps, for example, you can encode your soundtrack with standard defaults, getting a 64 Kbps RealAudio rate. At a combined speed of 104 Kbps, your presentation will have plenty of bandwidth to spare on DSL and cable modem connections.

RealAudio, it's important to grasp, is the most inflexible media type in terms of bandwidth use. Bandwidth choices are in a stairstep model: 20 Kbps, 36 Kbps, 44 Kbps, and so on, with no in-between choices. So when you plan to use RealAudio in a multimedia presentation, decide which bandwidth or bandwidths you want the audio clip to use. Then create your other clips to stream within the bandwidth that's left.

Tip
Remember not to count on having the connection's full speed (such as 28.8 Kbps) available. Always use as your maximum the top speed given in Table 3.

Changing RealAudio Defaults

If you own RealProducer Plus, you can choose exactly which RealAudio codec RealProducer uses for any combination of audience and audio type. You can't do this with RealProducer Basic, however. So if you want to become the ultimate power user, you'll need to upgrade.

To change the defaults, choose Options>Target Audience Settings>for RealAudio Clips... to display the dialog shown in Figure 2. Click the Audio Only radio button to change the standard codecs, or the Multimedia Presentation button to change the codecs used for clips combined with other media. Next, select the connection speed in the Target Audience pull-down menu. The four pull-down menus in the remainder of the dialog let you set the target audience's codec for each type of audio:

Because you can change any RealAudio default codec choice, there's nothing immutable about the target audience and audio type combinations. When you encode a clip, selecting voice-only audio for 28.8 Kbps modems might give you a stereo music clip for DSL connections because you've changed the defaults. This makes changing the defaults a powerful tool, but also a potentially confusing one if you forget how you've adjusted codec selection. Keep in mind, too, that you can choose between two distinct sets of defaults by clicking either the Audio Only or the Multimedia Presentation radio button.

Tip
Click Restore Defaults to return all settings to their defaults. This affects both the standard and the multimedia default settings.

Additional Information
The statistics that RealProducer shows after creating a clip help you verify that the clip is encoded the way you want. See "Viewing Statistics".

Changing RealAudio Defaults for Different Bandwidths

The most obvious reason to change the RealAudio defaults is to modify the streaming speed for a certain target audience and audio type. This is most useful for multiclip presentations. As noted above, you might not want to use RealAudio's reduced multimedia rates at higher connection speeds because the standard defaults leave plenty of bandwidth for other clips. (That's rarely true at slow speeds, though.) So you might leave the multimedia defaults for slow connection speeds at their presets, and use faster codecs for higher connection speeds.

Even if you want reduced RealAudio bandwidths at higher speeds, changing the multimedia defaults lets you target exactly which codec to use. Look at the mono music rates for the LAN and DSL/cable modem connections listed in Table 2 and Table 3. The streaming rate with the standard defaults is 64 Kbps. The multimedia rate weighs in at half that size: 32 Kbps. Between those two is a 44 Kbps mono music codec. If you're creating a presentation at 100 Kbps, and you want the best audio possible, you might bump the multimedia rate up to 44 Kbps as long as 56 Kbps is enough for the other clips.

Note
Always keep in mind the top streaming speed for connections as shown in Table 3.

Encoding High Response Music

The 20 Kbps and 32 Kbps mono music codecs both come in two flavors. RealProducer by default uses the "high response" versions, which are the better codecs for most situations. But you can also use the "normal response" versions. Table 4 lists the high response codecs and their normal response twins.

Table 4: RealAudio High and Normal Response Codecs
Codec Speed Frequency Response
20 Kbps Music 20 Kbps 10 kHz
20 Kbps Music-High Response 20 Kbps 20 kHz
32 Kbps Music 32 Kbps 16 kHz
32 Kbps Music-High Response 32 Kbps 20 kHz

The high response codecs cover a larger frequency spectrum than the normal response versions. As you can see with the 20 Kbps codecs, the high response version has twice the range as the normal codec. This means it provides crisper sound and is better at capturing high frequencies. With symphonic music, for example, the high response codec gets more of the flute and piccolo. It can produce more distortion than the normal response codec with voices and loud sounds such as drums, though.

If you're encoding music with a diverse range of frequencies, stick with the high response codecs. If you notice distortion, compare your results with a clip that uses the normal response codecs. The best tool for determining which codec to use is your ear. Listen carefully for minute differences in how the clip sounds. It also helps to have other people listen. Our own ears have different frequency responses, too.

Making a Mono Clip from Stereo Input

Take a look back at the mono and stereo music settings in Table 2. Until you get to the high speed connections, the mono and stereo bit rates are the same. What isn't the same, though, is the quality. Mono music has one channel that gets sent to both speakers. Stereo music has separate channels for the left and the right. That means a stereo version of an audio clip holds twice as much data as a mono version. Yet RealProducer makes stereo and mono clips the same size. How can it do this?

The answer lies in the codecs' frequency responses. Remember, RealAudio is a lossy compression scheme that throws out data. The stereo codec squeezes both channels down to the same size as the mono codec by throwing out more data for each channel. This makes its frequency response lower. To put it simply, a stereo clip doesn't represent all frequencies as accurately as a mono clip. You'll hear the two channels, but they may not sound as crisp as a mono channel.

The lower frequency response is not necessarily a bad thing. If the music falls within the codec's response range, the mono and stereo clips won't differ greatly (except with stereo you get the two channels). If a stereo clip sounds muddy, try encoding the audio source as a mono clip. RealProducer is smart about the stereo-to-mono conversion. It doesn't simply throw out a channel as some audio programs do. Instead, it blends the two channels into the mono channel. This is called "panning to the middle." If it didn't do this, a musical instrument recorded on only the left or right channel might simply vanish from the recording!

Tip
If you're a pro or budding audiophile, run the stereo-to- mono conversion in your audio editing program so you have full control over the result.

Additional Information
"RealAudio Codec Reference" lists each RealAudio codec's frequency response.

Using Mono at Low Speeds, Stereo at High Speeds

Stereo encoding steps into the limelight at higher bandwidths. The higher the streaming speed, the better the stereo frequency response. You may find that the best compromise is to provide mono music at low bandwidths, stereo music at high bandwidths. You can do this by producing two different versions of your audio file. Or you can change the RealProducer Plus defaults to encode stereo music as mono at low speeds and as stereo at high speeds where the stereo codec frequency response is greater.

If you stick with the stereo codecs at higher connection speeds, SureStream clips are stereo when bandwidth is plentiful, mono when it's sparse. If the clip has to downshift from high to lower speeds, the music shifts from stereo to mono, but the sound stays brighter. You might change the 28.8 and 56 Kbps default targets for stereo music to use the 20 Kbps and 32 Kbps mono codecs, for example. Figure 3 illustrates changing the 28.8 Kbps stereo music target from stereo to mono. Note how the frequency response doubles.

Figure 3: Mono Encoding for Stereo Audio at for 28.8 Kbps Modems

Additional Information
"Changing RealAudio Defaults" explains how to change the default codec selections. "RealAudio Codec Reference" lists the frequency response of each codec.

RealAudio Codec Reference

This section provides a reference for all RealAudio codecs used by RealProducer, broken down into separate tables for voice, mono music, and stereo music codecs. There are no separate voice-with-music codecs. When you choose voice with music, RealProducer uses a voice codec. Each table lists 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 and prevents pitch shifting in audio resampling. Audio quality degrades if you use lower than the optimum sampling rate. If you use a higher sampling 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 a CD-quality sampling rate of 44.1 kHz.

The frequency response column lists the codec's frequency response in Kilohertz. 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. RealAudio encoding always results in a clip of equal or lower quality than the original audio. If the original audio 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.

Additional Information
The audio preparation chapter of RealSystem Production Guide has an expanded list that covers all RealAudio codecs, including obsolete codecs no longer used by RealProducer.

Voice Codecs

RealProducer uses a voice codec when you encode a voice-only or voice-with-music clip. The lowest-speed voice codec normally used with RealAudio is 16 Kbps. The lower-speed codecs are used as "duress" streams in SureStream clips. They're also used to encode soundtracks for low-bandwidth RealVideo clips.

Table 5: RealAudio Voice Codecs
RealAudio Codec Sampling Rate Frequency Response
5 Kbps Voice 8 kHz 4 kHz
6.5 Kbps Voice 8 kHz 4 kHz
8.5 Kbps Voice 8 kHz 4 kHz
16 Kbps Voice 16 kHz 8 kHz
32 Kbps Voice 22.05 kHz 11 kHz
64 Kbps Voice 44.1 kHz 20 kHz

Mono Music Codecs

As with the voice codecs, the lowest-speed mono music codec normally used with RealAudio is 16 Kbps. The lower-speed codecs 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 high response version by default.

Table 6: RealAudio Mono Music Codecs
RealAudio Codec Sampling Rate Frequency Response
6 Kbps Music 8 kHz 3 kHz
8 Kbps Music 8 kHz 4 kHz
11 Kbps Music 11.025 kHz 5.5 kHz
16 Kbps Music 22.05 kHz 8 kHz
20 Kbps Music 22.05 kHz 10 kHz
20 Kbps Music-High Response 44.1 kHz 20 kHz
32 Kbps Music 44.1 kHz 16 kHz
32 Kbps Music-High Response 44.1 kHz 20 kHz
44 Kbps Music 44.1 kHz 20 kHz
64 Kbps Music 44.1 kHz 20 kHz

Stereo Music Codecs

The slowest stereo codec is 20 Kbps. Stereo codecs don't go lower than that because they would not have enough frequency response for adequate sound. You can always encode stereo music with a lower-speed mono codec, though. RealProducer converts the music to mono for you. Don't encode mono music with a stereo codec, though. You don't get stereo music, just a lowered frequency response.

Table 7: RealAudio Stereo Music Codecs
RealAudio Codec Sampling Rate Frequency Response
20 Kbps Stereo Music 11.025 kHz 5 kHz
32 Kbps Stereo Music 22.05 kHz 8 kHz
44 Kbps Stereo Music 22.05 kHz 11 kHz
64 Kbps Stereo Music 44.1 kHz 16 kHz
96 Kbps Stereo Music 44.1 kHz 20 kHz


Copyright © 2000 RealNetworks
For information on RealNetworks' technical support, click here.
Comments on this document? Click here.
This file last updated on 06/16/00 at 10:53:46.
previous next