Saturday, June 22, 2024

So You Want Real Audio, Huh?

…use these to jump around or read it all

[How RealAudio Works]

[RealAudio From Your Site]

[Offering the RealAudio File]

[Creating the RealAudio Sound File]
[Creating the Meta File]

[The HTML Document]

[What’s the Down Side?]

Hear Me Speak – Click Below

     I have up a couple of other tutorials dealing with sounds on the net. I have one on embedding MIDI and other formats of sound, and I have one on using the Meta Refresh dynamic commands for playing different formats. I have stayed away from RealAudio mainly because, in the past, RealAudio couldn’t be done straight off of a WWW server. You needed a RealAudio server to run the format.

How Real Audio Works

     The process of RealAudio was explained to me by two different Internet server tech people. (These guys know words that don’t exist in any language). After they explained for a good 15 minutes, they stopped, noticed I had completely glazed over, and decided to give it to me in simple terms.
Note that the process is much more involved than this, but here’s the general idea…

     If you put a sound on your WWW page, say a .wav or a midi. You are using what is known as a “helper application” or a “plug in.” Either way – you are calling on another piece of software other than the browser itself to play the sound. The problem with that was that it took some time because the entire file has to download – then be loaded into the helper application – then it could play. Depending on download speeds, net congestion, file size, and your modem speed, this could take a long long time.

     Where RealAudio beat them all was that it played the sounds almost instantaneously. It amazed me the first time I heard it and saw it work. If you did what I did, you went to the RealAudio site, didn’t bother to read any of the documentation, grabbed the RealAudio converter, and placed a few files on your server. Mine didn’t work either.

     The reason it didn’t work was because of downloading time and pace. For example, if you download an image file and sit there watching the numbers tick by in the status bar of your browser, you’ll notice that the numbers are by no means consistent. You get a burst of data here and there, but there are also down times. You have to remember that you are not the only person being serviced by the system and that other people need the file too. That’s the down time – while others are being helped.

     RealAudio works by creating a buffer, or specific connection, between your computer and a RealAudio server. Once the connection is established, the transfer of data is consistent and at a set pace, usually the pace of your modem.
That way the file can be played as it is being downloaded. But the pace is the key here. HTTP servers don’t offer the pace the RealAudio server does.

     But there has to be a way to play these things off of my site – you say.

     There is now! – I reply.

RealAudio From Your Site

     In order to run RealAudio sound files from your HTTP server, you’re going to need a few things – luckily they’re all free for the downloading. You’ll need:

[The Real Audio Player version 3.0 or better]

[The Real Audio Sound Encoder]

[A RealAudio Meta File]
I’ll show you how to make one of those.

Offering the RealAudio File

     First things first. If you’re going to do this, your server must have two MIME type settings:

audio/x-pn-realaudio (files with a .ra or .ram file extension)

audio/x-pn-realaudio-plugin (files with a .rpm file extension)

     These settings are nothing that you can do yourself. You will need to contact your system’s administrator and ask for the settings to be made. Most servers already have these settings, but it’s best to check.

     What those settings are doing is telling the HTTP server than when you see a file with the extension .ra or .ram, load up the Real Audio server to play the sound.

Create the RealAudio Sound File

     You will use the RealAudio encoder to do this. If you haven’t installed it on your computer yet, do it.
It’s rather simple to use. The hardest part is getting the .wav file to convert to RealAudio. That’s the catch of this tutorial. You have to be able to make a sound file. Most newer computers have a microphone or a sound recorder program on them. Use it to make a file. Then open that file in the RealAudio encoder and encode it. You should now have a file with the same name as the original but with an “.ra” extension. That stands for RealAudio.

Creating the Meta File

     Now it gets a little tricky. If this was a simple .wav or MIDI file, you could just transfer it to your server and make an HREF link to it and it would play. Not so here. You need a buffer between the page and the RealAudio sound file. That buffer is the META file. Here’s what you do:

  • Using a text editor, create a simple text file that only has the path to the RealAudio file on your server.

     For example, your file is called “joe.ra”. You place it on your server named “”. Your Meta file will contain only this line of text:

     Don’t use any html commands. Don’t use any quote marks. Don’t put anything else in the file other than the path to your RealAudio file. Just that.

     Now save the small text document with the extension “.ram”. If you want to name to Meta file “joe”, then save it as “joe.ram”. Get it? Now you have your meta file ready to go.

     Transfer them both to your server. Make sure the sound file goes as binary.

The HTML Document

     Now it’s time to call for the RealAudio file in a document. It would make sense that you would just make a link straight to the sounds file. Not so. In this case you make a link to the Meta file. Note! The Meta file only has the path to the RealAudio file inside of it.

     Remember above where you set the server setting so it related RealAudio with the .ram extension? Now that is coming into play. The process goes:

  • The HTML Document calls on the Meta file.
  • The call on the Meta file denotes to the server that a RealAudio file will be used here.
  • The RealAudio file begins a download.
  • The file starts playing after enough has downloaded to be read and understood.

     …and off it goes.

So What’s the Down Side?

     There are a few:

  • The viewer must have the RealAudio player 3.0 or better
  • If the MIME Settings are not correct, the text of the Meta file will display
  • The net may be congested so that the download is so sporadic that it won’t work.

…but it’s better than nothing as I always say.

[How RealAudio Works]

[RealAudio From Your Site]

[Offering the RealAudio File]

[Creating the RealAudio Sound File]
[Creating the Meta File]

[The HTML Document]

[What’s the Down Side?]

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles