WebHints: RealAudio

Introduction

Adding a sound to a web page is easy. All you do is use a sound program to record the sound in AIFF or AU format, put the resultant .aiff or .au file in your web, and then link to it. When people click on the link, their browser will download the sound file, and it will be played by the appropriate plugin or helper application.

The only trouble with sounds included in a web in this way is that the surfer has to download the entire sound file before they can start to play the sound. This means that the user has to "pay" in advance (in waiting time) for the entire sound, even if they discover after a few seconds of listening that they don't want to hear the whole sound. These up front economics means that many surfers won't even try clicking on sounds; it's just not worth the wait.

This problem has provoked the creation of a number of streaming sound technologies. In these technologies, a special program on the webserver feeds the sound piece by piece to a special program on the client that plays the sound as it receives it. So long as the server and the network can keep up with the client's real-time need for new packets, the result is a continuous stream of sound transferred from the web to the user.

One of the most popular of these audio streaming technologies is RealAudio. This is a proprietary technology owned and sold by Progressive Networks. The technology consists of:

  • A new compressed-audio sound file format (.ra).
  • Programs to convert conventional-format (e.g. .AIFF/.AU) sounds to the RealAudio (.ra) format.
  • Client helper application "players".
  • Server programs to stream the RealAudio files to the clients.

All this software is FREE except for the server software which costs several hundred dollars per webserver. This charging model encourages surfers to upload the RealAudio client (thus increasing the "installed base") and web creators to add RealAudio sounds to their webs. This strategy seems to have worked as, according to Progressive Networks, as at March 1997, over eleven million RealAudio clients have been downloaded from their website and there are about 40,000 new downloads each day. This huge installed base makes RealAudio mainstream enough not to annoy surfers who encounter a RealAudio sound; if they haven't already installed the RealAudio client, then perhaps it's about time they did! Once the client is installed, the surfer can be sure that they will encounter and be able to play lots of other RealAudio sounds on other webs too.

In the end, payment for the RealAudio system is made by ISPs who in turn indirectly collect the money from their clients through web server annual fees. Servers are licensed to serve a fixed number of streams simultaneously. The more streams desired, the higher the cost of the server licence. At the time of writing (17 March 1997), Internode Professional Access (IPA - the ISP I use) has just purchased a 60-stream RealAudio server licence. This means that webs hosted on the IPA webserver can contain RealAudio sounds which will be served by the IPA server in real time.

If your web isn't on the Internode Professional Access webserver, you'll need to contact your ISP to see if they have a RealAudio server licence. If they don't you can still use the RealAudio format, but you won't be able to stream.

Try Out RealAudio Now!

Before creating your own RealAudio content, you will need to install a RealAudio client which Progressive Networks call the RealAudio Player. Do this now. It doesn't take long.

The RealAudio Player

Once you've installed the client, you will be able to play RealAudio sounds. Here is an example RealAudio sound from the Brainspace web:

Tim And Debbie Talk About Bali

If you've installed the RealAudio player correctly, what should happen when you click on the above link is that a RealAudio player window should pop up. There will be about a ten second delay as the player buffers the first few seconds of the sound, and then the sound will start playing. Depending on network load, there may be some gaps or dropouts or noise, but the sound should essentially play through to completion from that point. Here are some other sounds to try. No doubt these RealAudio links will rot one day, so I've included the link to each enclosing site too.

Pretty Vacant from The Sex Pistols site.

Create Your Own RealAudio Content

Now that you're sure that you your RealAudio client is working, you are now in a position to create your own RealAudio content.

Step 1: Record The Sound

The first step is to actually record the sound. To do this, you will need a computer with a microphone and some sort of sound recording software. If you use a Macintosh, you can use a program called Sound Sampler which you can find in various Internet FTP archives under the name snd-sampler-321.hqx (use Archie to search for snd-sampler*.hqx). In particular, you can find it in the following FTP directory:

Sound Sampler (Look for e.g. snd-sampler-321.hqx)

Record your sound using the following settings and save the sound on disk. I haven't gone into sound production in detail, but the following Sound Sampler settings worked for me.

Sample rate:22254.54546
Width:8 bits
Compression:None
Stereo:None
Play through:Off
Auto gain:On

If you have a PC, I have been told that a good sound editor for Windows95 is CoolEdit from Syntrillium.

Step 2: Convert The Sound To The RealAudio .ra Format

At this point, you should have your sound in a single file. The next step is to convert the sound file to the RealAudio .ra format. To do this, you need the RealAudio Encoder. You can download a version of the RealAudio Encoder for your platform from:

The RealAudio Encoder Page

Use the RealAudio Encoder to encode your sound file into a .ra file.

The RealAudio Encoder only accepts certain sound formats as inputs so you'll have to ensure that your sound is in one of those formats before you can do the encoding. If you're using a Macintosh, you'll need to get the sound into one of the following formats.

  • Sound Designer II (SD2).
  • AIFF.
  • AU.
  • System 7.

There are a wide range of freeware/shareware programs available on the Internet to perform such conversions.

Note: Sound Sampler for the Macintosh outputs its sounds in System 7 format, so if you use it, you won't have to perform a conversion before invoking the RealAudio Encoder.

Note: The RealAudio Encode really consumes CPU. I have a 25MHz 68040 Macintosh with a DSP and I find the RealAudio encoder to be painfully slow. In one instance I found that it was taking about one minute to encode each second. I don't know why it needs to be so slow, but it is. So be patient, or buy a faster machine.

Step 3: Create A .ram File

At this point you should have a RealAudio sound file called mysound.ra or something like that. If you put it in your web it will actually work. However, it won't stream: the surfer will have to load the entire sound before it will start playing. Here's a direct link to the .ra RealAudio sound file for the Tim and Debbie sound that was featured earlier. If you click on it, you will see that the entire sound is downloaded before the RealAudio player starts playing the sound.

Tim And Debbie Talk About Bali (.ra file)

The fact that this works demonstrates that you can use RealAudio in your web without purchasing a RealAudio server licence, so long as you can put up with it not streaming. So you can at least take advantage of the high-quality high-compression properties of the RealAudio format even if you can't afford to purchase a licence for a streaming server. Also, if you expect that your ISP will eventually purchase a server licence, you may wish to prepare all the sounds in your web in RealAudio format in preparation for the great day. Note: The Configuring Your Website page of the RealAudio web contains a discussion of how those capable of configuring webservers can configure them to deliver streaming audio using HTTP. It's not as good as a RealAudio server, but apparently it sort of works.

If your webserver does have a RealAudio server on it, you can invoke the RealAudio server by preparing a RealAudio .ram file that refers to the .ra sound file. The .ram file is simply a text file that contains a sequence of lines, each of which contains the URL for a .ra file. When the .ram file is invoked, each .ra sound file in the list it contains is played in sequence. Here is an example of the contents of a .ram file. In this case, the .ram file consists of a single line (so just one sound will be played). The URL specified in the .ram is just the same as a web URL except that http:// is replaced by pnm://. PNM stands for Progressive Networks Metafile.

pnm://www.ross.net/webhints/binary/p026_02_bali_life.ra

There's another catch too, and here I will refer specifically to the details of the Internode Professional Access (IPA) webserver. On the IPA webserver, every "corporate" URL on the IPA webserver also has a corresponding www.on.net URL. Here are some examples:

Corporate URLIPA Server URL
http://www.ross.net/ http://www.on.net/clients/ross/
http://www.rocksoft.com/ http://www.on.net/clients/rocksoft/
http://www.woodart.com/ http://www.on.net/clients/woodart/
http://www.madderns.com/ http://www.on.net/clients/madderns/

If you try some of the above URL pairs you'll see that they lead to the same place. The difference is that in the left case, you are accessing the file through the corporate virtual server, and in the right case, you are accessing the file through the Internode virtual server. All these virtual servers all run on the Internode (physical) webserver.

When you write your .ram file, the pnm:// URLs that you specify on each line must be in the Internode format, not your "corporate" format. If you specify the URls using your corporate domain name, the surfer's RealAudio client will report an error when it attempts to read the .ra file.

Here's a link to the .ram file that contains the URL for the Tim and Debbie sound. You should find that if you click on it, that the RealAudio player will stream the sound.

Tim And Debbie Talk About Bali

The .ram file consists of a single line being:

pnm://www.ross.net/webhints/binary/p026_02_bali_life.ra

Progressive Networks suggests that whenever you link to a RealAudio file, that you include the following RealAudio balloon to let your surfers know that they can play a sound without having to wait for it to download.

Embedding Controls

Sometimes it can seem a bit annoying to the user to have a RealAudio window pop up, and so the RealAudio people have enabled RealAudio controls to be embedded within a page. Here is an example of this:

<A HREF="realaudio_example.ram">Your Browser Cannot Embed This :-(</A>

Note: This doesn't work on my Macintosh. I think my version of the RealAudio player is too old (and I can't get the new one because I don't have a Power Macintosh). But it might work for you!

The HTML for doing this is as follows:

<EMBED SRC="realaudio_example.rpm" WIDTH=300 HEIGHT=134>
<NOEMBED><A HREF="realaudio_example.ram">Your
Browser Cannot Embed This :-(</A></NOEMBED>

Here's an example of a smaller control panel:

<A HREF="realaudio_example.ram">Your Browser Cannot Embed This :-(</A>

This was achieved simply by adding the attribute CONTROLS=ControlPanel to the EMBED tag. The facilities for embedding controls are VERY flexible. For more information on this, see the RealAudio Configuration Page.

Further Information

For further information on RealAudio, see the following pages of the RealAudio web:



* * Webmaster: ross@ross.net
Linkhere: Click here to find out how to link here.
Copyright: Copyright © Ross N. Williams 1995-1996. All rights reserved.