Customer Support
International Downloads Documentation Real.com RealNetworks.com
Attaching RealAudio 5.0 and Earlier Files to Web Pages

  1. Introduction

  2. Adding RealAudio Content with the RealAudio Server

Introduction

RealAudio technology utilizes an interactive system between the RealAudio Server and the RealAudio Player to enable real-time audio delivery over the Internet. When the user clicks on a link on a Web page, the audio buffers and then begins to play, all within a few seconds. This gives the deceiving impression that the RealAudio file is linked directly to the Web page. In reality, information is passing between the Web server supporting the Web page, the RealAudio Server supporting the audio file, and the RealAudio Player. If you have a RealAudio Server and you do not understand how the RealAudio system works, read the next section about the file delivery process.

RealAudio File Delivery Process

If you have written HTML documents in the past, then you know that links to other documents are shown in the HTML document as the URL address of the document you wish to access. Since RealAudio files are resident to the realAudio Server and can only be retrieved by the RealAudio Player, a few extra steps must be taken to complete the network path that links to the audio file. When the user clicks on the RealAudio link, it is actually activating a metafile, which in turn sends the location of the RealAudio file to the Player. The Player then sends a signal to the RealAudio Server requesting that file. The file is sent to the Player and played as it is received. The entire process is completed within seconds.

Adding RealAudio Content With the RealAudio Server

If you have a RealAudio Server or a RealAudio Personal Server, you will need to create a document to attach to your Web page, which contains the URL location of your RealAudio file. This file is called a metafile (signified by the .ram extension). You will also need to configure your Web Server to recognize .ra and .ram MIME types.

What is a Metafile and How Does it Work?

Metafiles are text files which contain the URL location of a RealAudio file. Remember that RealAudio files cannot be referenced directly by the Web page because this would cause them to be downloaded in their entirety before playback. In order for the audio files to be played in real time, they must be played through a RealAudio Player, and served by a RealAudio Server. Therefore there must be a link between the Web server and the RealAudio Server. The link is contained in the metafile.

Imagine the Web page as a sheet of paper with directions to someone's house written on it. For most documents, you would follow the directions and arrive at the house you are looking for. For RealAudio files, the Web page is like a sheet of paper that gives you directions to a house, and once you arrive at the house, there is another piece of paper attached to the door with a set of directions to another house, which is your actual destination.

The first set of directions represents a link in the HTML document to a metafile, recognized by its .ram extension. The second set of directions represents a link from the metafile to the RealAudio file, recognized by its .ra extension. Instead of pointing to the audio file, the HTML that comprises your Web page will point to a metafile. Unlike the usual HTML link, the metafile does not display information through the browser, but rather, it provides the audio file's URL to the RealAudio Player. The Player uses this information to locate the .ra file on the RealAudio Server.

Creating .RAM Metafiles

Metafiles are text files you create that contain the location of an audio file. Use the following format:

pnm://hostname/path

For example, you might have the following reference for file welcome.ra :

pnm://www.real.com/welcome.ra

The metafile does not require any other commands or information. You can put more than one file location in the metafile, and it will play each file consecutively. When saving the metafile, use the .ram extension. The previous example might be saved in a file with the name welcome.ram.

In your HTML document, reference the metafile in a hyperlink, as follows:

<A HREF="http://www.real.com/welcome.ram">Welcome!</A>

The metafile does not require any other commands or information. If you have spaces or control characters in this file, some versions of the Player will not be able to translate the text into a URL. You can put more than one file location in the metafile, and it will play each file consecutively. When saving the metafile, use the .ram extension. The previous example might be saved in a file with the name welcome.ram. When you ftp the metafile to your Web server, choose ascii for the transfer mode.

In your HTML document, reference the metafile in a hyperlink, followed by a reference to the RealAudio icon (so that the RealAudio icon will display to the left of the file) as follows:

<A HREF="http://www.real.com/welcome.ram"><IMG SRC="http://www.real.com/pics/rafile.gif" align="left" border="0" hspace="10">Welcome!</A>

The welcome file will appear on your Web site as follows:

Welcome!


Configuring the Web Server for RealAudio

Once you place a metafile on your Web server, you'll need to configure the server to recognize the .ram extension as the MIME type x-pn-realaudio. The MIME type will be displayed in the HTML header sent to the user's Web browser. This, in turn, activates the RealAudio Player so that it can retrieve and play the RealAudio file. Since servers are configured in different ways, you will need to choose from the following list for instructions for your server.

Netscape Netsite
Windows NT (EMWACS HTTP 0.96)
NCSA HTTPD (v. 1.3 and 1.4)
CERN HTTPD (v. 3.0)
O'Reilly Website NT
Microsoft Internet Information Server

Netscape Netsite

To the MIME.types file, add the following line:

type=audio/x-pn-realaudio exts=ra,ram

You will also need to add the following line to the server's main configuration file (called magnus.conf in the Netsite documentation):

Init fn=load-types mime-types=mime.types

After adding these commands, you will need to reinitialize the Web server.

Windows NT (EMWACS HTTPS 0.96)

In the HTTP server applet in the Control Panel, click on the button along the right hand side of the window marked "New Mapping."

A dialog box will be displayed which shows existing MIME type mappings, along with a "Filename extension"text entry box along the top. Type the filename extension "RAM" into the extension field, and then enter the MIME type into the text entry field above the scrollable list of existing MIME types:

audio/x-pn-realaudio

Select OK to add the new MIME type to the main list. You must reinitialize your web server for the changes to take effect.

NCSA HTTPD (v. 1.3 and 1.4)

For NCSA, two approaches are possible.

You must reinitialize your web server for the changes to take effect.

CERN HTTPD (v. 3.0)

Add the following line to the "httpd.conf" file under the Server's root directory

AddType .ram audio/x-pn-realaudio binary

Reinitialize your Web server for the changes to take effect.

O'Reilly Website NT

On the mapping page, use the admin tool to change the MIME type by giving the following command:

.ram audio/x-pn-realaudio

You must reinitialize your Web server for the changes to take effect.

Microsoft Internet Information Server

MIME type configuration is done in the Windows NT Registry.

To edit the registry:

  1. Log on as Administrator.
  2. Start Regedt32.
  3. Locate the following entry:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters\Mimemap

  4. Click Add Value on the Edit menu.
  5. In the Add Value box, enter:

    audio/x-pn-realaudio-plugin,rpm,,<

  6. Select REG_SZ in the Data Type box and click OK.
  7. Leave the String box blank and click the OK button.
  8. Repeat Steps 4 through 7. For Step 5, enter:

    audio/x-pn-realaudio,ram,,<

For further information on changing the Windows NT Registry consult the Windows NT Help file and documentation.