LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Listen Print Subscribe to Linux Subscribe to Newsletters

Streaming Media With Linux
Pages: 1, 2, 3, 4, 5, 6

Common streaming audio formats and players

Uncompressed CD-quality WAV and AIFF files are too large to stream over the Internet for playback in real time. Instead, lighter-weight compressed formats such as MP3 and RealAudio are employed for streaming network audio. These formats use what are called "lossy" compression schemes, reducing file sizes by eliminating certain inaudible data from the original files without too significantly degrading playback sound quality. MP3 and RealAudio are excellent streaming formats, achieving performance factors great enough to allow real-time encoding/decoding over current network bandwidth conditions while delivering satisfying audio quality.



MP3 and RealAudio are not the only players in the network streaming audio arena. We'll also look at Macromedia's Flash and the Ogg Vorbis project from the Xiphophorus group. Since RealAudio's Internet history begins the earliest, we'll start with RealAudio.

RealAudio

In 1995, Progressive Networks (now RealNetworks) introduced RealAudio, the Internet's first widely-deployed streaming audio format. The RealAudio player (RealPlayer) was freely distributed to users who at that time were typically connected to the Internet via low-bandwidth modems; thus, the player supported connection rates as low as 14.4 Kbps, which delivered audio quality comparable to the sound of a decent AM radio. Faster connections such as ISDN accordingly improved reception speed and sound quality.

By giving away basic versions of RealPlayer and the RealProducer content-production utility, Progressive Networks seeded the market for their commercial product line and sparked an explosion in network multimedia. Today you can find an astonishing number and variety of RealAudio-enabled sites. As a curious example, I searched Google for "realaudio history", hoping to find some background material on the format; instead, I found thousands of sites dedicated to various historical topics, all of which included audio presentations requiring RealPlayer.

RealPlayer Basic tuned in to NetRadio.com.
Figure 1. RealPlayer Basic tuned in to NetRadio.com.

RealPlayer: RealAudio in X

Happily, RealPlayer is available for Linux, and you can retrieve it for free as either an RPM or tarball package from the Real.com downloads page. Installation is fairly straightforward, but there are a few snags to report. Close your web browser before installing the software, then become the root user and run the installation package. The RPM file needs to be renamed:

mv rp8_linux20_libc6_i386_cs1_rpm rp8.linux20.libc6.i386.cs1.rpm

before installing it (as root) with this command:

rpm -i rp8.linux20.libc6.i386.cs1.rpm

The tarball must have its permissions set (as root again):

chmod u+x rp8_linux20_libc6_i386_cs1.bin

Now you can run the installation package:

./rp8_linux20_libc6_i386_cs1.bin

The installation procedure will automatically set up RealPlayer as a helper application in Netscape, but be forewarned: It will also overwrite any custom settings you have for audio formats such as WAV, AIFF, and AU, so you may want to back up your Netscape preferences before installing RealPlayer. Also, the installation will not automatically update the RealAudio plug-in. Close Netscape, copy the rpnp.so file from your new $HOME/RealPlayer directory to $HOME/.netscape/plugins, fire up Netscape again, and your RealAudio plug-in should now be enabled. Check the Help/About Plugins menu item in Netscape for a status report.

TRPlayer: RealAudio for the console

At least three RealAudio players are available for the Linux console. They all depend upon an existing installation of RealPlayer and act as wrappers for RealPlayer, making its functions available to console applications. The RAP and RaWrapper players require support for the frame-buffer device; I wanted to avoid the need for any special graphics support (such as SVGA, frame-buffer, or ncurses) in my console RealAudio player, so I chose Matthew Campbell's TRPlayer.

TRPlayer is available as a binary in RPM and DEB packages, but I chose to build the latest beta version (2.0.b2) from the source tarball. TRPlayer's only unique requirement is the slang library and header. Fortunately, slang is found on most mainstream Linux distributions, and a straightforward ./configure; make should have your player ready to rock. However, due to the filesystem vagaries of Linux distributions your build may fail with this message:

main.cc:17: slang.h: No such file or directory
make: *** [main.o] Error 1

If so, change this line in main.cc:

#include <slang.h>

to this line:

#include <slang/slang.h>

and recompile.

When the build is complete, become root (su root), run make install, and you will have a new command-line RealAudio player. You can call it from the prompt at the console or in xterm, invoking it with an address linking the player to the RealAudio stream:

trplayer http://www.orientaltunes.com/realaudio/Train-288.ram

You now have streaming RealAudio at the Linux console. Cool...

Reality check

RealNetworks deserves praise for maintaining and steadily improving a freely available RealPlayer for Linux, particularly since there's no other way to enjoy all those RealAudio-empowered sites. Harder-core users and developers might be dismayed to learn that Real's software is available only in binary format and that source code is not freely available. Nevertheless, there's only one place to go for RealPlayer, so if you want it, there you go.

Now let's look at that other major streaming audio format, the notorious MP3.

Pages: 1, 2, 3, 4, 5, 6

Next Pagearrow




Tagged Articles

Post to del.icio.us

This article has been tagged:

linux

Articles that share the tag linux:

Managing Disk Space with LVM (74 tags)

Use Your Digital Camera with Linux (60 tags)

mdadm: A New Tool For Linux Software RAID Management (59 tags)

Asterisk: A Bare-Bones VoIP Example (43 tags)

View All

streaming

Articles that share the tag streaming:

Streaming Media With Linux (11 tags)

Streaming QuickTime with Java (3 tags)

MP3 Sound Bites (3 tags)

View All

radio

Articles that share the tag radio:

Streaming Media With Linux (5 tags)

Hacking Radio on the Mac (4 tags)

View All

music

Articles that share the tag music:

Hacking Perl in Nightclubs (36 tags)

Unify and Synchronize Your iTunes Libraries (29 tags)

View All

media

Articles that share the tag media:

MP3 Sound Bites (11 tags)

Remixing Culture: An Interview with Lawrence Lessig (11 tags)

Movies of Software (7 tags)

View All

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2009, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com