Into the World of MP3

Dr. Dobb's Journal September 2000

By Al Stevens

Al is DDJ's senior contributing editor. He can be contacted at astevens@ddj.com.
MP3 Compression

In the January 2000 issue of DDJ, Mark Nelson published the article "The Ultimate Home Jukebox" about adding a relatively inexpensive 18 GB hard drive to a PC and using MP3 technology to build a high-capacity, music-playing jukebox. This was followed in the May 2000 issue by Jawed Karim's "A Win32 Network Crawler" that presented a tool for searching local area networks for files built with MP3 technology. Music being my other profession, these articles got my attention, particularly the part about MP3 technology, which is, among other things, a compression/decompression algorithm that compresses audio files to as small as 1/22nd their original size with quality compromises depending on how much compression you want. Following up on those articles, I rummaged around the Internet for information about MP3. I found lots of software, source code included, uncovered a wealth of cool technology for programmers, and learned a bunch of new words.

"Ripping" is the process that reads the audio tracks of a compact disk into memory as digital data and stores those data in an audio file on disk. PCs typically use the .WAV format to store audio files. "Encoding," in this context, is the compression process that converts an audio file to an MP3 file. "Playing," of course, is the process that decodes MP3 compression and plays the music. Most CD/R drives include software that rips, and you can find rippers on the Internet. Encoders are available, too. Some programs do both processes in one pass, eliminating the need to set aside space for interim WAV files. There are several shareware MP3 players that you can download. You can play MP3 music on most contemporary Windows CE machines, too, but you have to pay for that software, perhaps because its developers have to pay for the technology. The RealAudio streaming audio player can play MP3 files. So can the latest version of the Windows Media Player. And there are numerous dedicated portable MP3 player devices.

In the course of my research, I discovered that MP3 is more than an algorithm, a format, and software -- MP3 is a culture, a movement, a religion, almost. Why? Because the ability to reduce audio files to a tenth of their usual size with barely perceptible loss of quality empowers people to post and exchange music files with a minimum of connect time. Millions of people, it seems, want to do exactly that. That's a significant development. A 3-minute performance encoded for CD-quality audio requires about 30 MB on a hard disk in .WAV format. The same song takes about 3 MB in MP3 at the same quality -- well, almost the same. MP3's compression removes frequencies above and below the spectrum audible to people. It also removes waveforms that you can't hear because louder waveforms drown them out. (See the accompanying text box for a discussion of this curious audio phenomenon.)

That's all there is to it. MP3, by compressing huge audio files down to manageable sizes, lets you send your Twisted Sister to your straight brother. And all your friends. And everyone else in the world. There are dozens of web sites dedicated to MP3 users. There are thousands that have free MP3 files you can download. There are many software and hardware products that support the format.

The Bootlegger's Dream

Of course, virtually every site you visit, every book you read, and every product you buy includes a warning that you must use the technology and products for encoding, copying, posting, and exchanging music files only when you have legal permission to do so. Yeah, right.

As a working musician perhaps I should object to the blatant bootlegging that MP3 encourages. I should, but I don't, for several reasons. For one, after looking at a bunch of what you can download, I realized that virtually none of it is anything I'd want to listen to. I don't care if people freely exchange that junk. The crime would be making anyone pay for it. Okay, I'm an old fuddy-duddy because I can't stand the contemporary noise that some folks, including some of my readers, call music. Truth be known, I haven't liked much popular music since I was 5 years old. I suppose my apathy about the intellectual-property rights of rap performers threatens the rights of other performers, myself included. Can't help it.

Another reason I don't object to MP3 bootlegging is there's nothing anyone can do about it. The Recording Industry Association of America (RIAA) prevailed in a recent judgment that prohibits MP3.COM from letting users post CD collections at the web site for their own use. MP3.COM allowed users to "upload," so to speak, their CD collection. Then, by logging onto MP3.COM and using MP3 streaming audio technology, those users were able to listen to their CD collection anywhere they could find an Internet connection. That was how MP3.COM represented the feature, but it was really only another way for users to blatantly bootleg copyrighted material.

You see, no real upload of audio data happened. MP3.COM's software sensed the CD's identification code and added selections to the user's account from MP3.COM's archives of thousands of commercially released CDs. Presumably, by reading those identification codes, MP3.COM verified that users owned legally obtained copies of each CD in the users' online collection. But nothing ensured that multiple users would not use the same copy of a passed around CD to upload and add to their collection, and nothing prevented a user from giving their CDs to others once their collection was uploaded. In other words, nothing tied the online copies of intellectual property to the media on which they were legally distributed past the first verification.

The outcome of the RIAA lawsuit was an agreement between MP3.COM, Warner Music Group, and BMG Entertainment, which allows MP3.COM, in return for an undisclosed but presumably substantial settlement, to put the users' collections back online. But that settlement is only a bump in the road. All it does is discourage institutionalized bootlegging. Technology evolves and things change. People and laws have to adjust. The Internet will drastically change conventional notions of intellectual property and how people are reimbursed for their creative efforts. It will take a while, but some day when the judicial system realizes copyright laws can't be enforced anymore, the laws will have to change. I heard a quote the other day from a pontificating lawyer in a TV drama, "Without law there is no freedom; without justice there is no law." To that I would add, "Without enforcement, there is no justice." In the mean time, MP3.COM is working out more licensing agreements with other copyright holders to permit them to resume the service that the RIAA lawsuit dismantled.

The whole issue is like human cloning. If something is possible, irrespective of all the social, moral, legal, and ethical implications, somebody somewhere is going to do it. And, because of the international anarchistic nature of cyberspace, people are unconcerned about those implications. People have never hesitated to break laws when they can't be caught. In this case, most people don't see any harm in it. They argue that since they wouldn't buy the stuff they steal, and the act removes no physical property from the victim, making and using bootleg copies hurts nobody. Occasionally I'll respond to someone on a newsgroup who asks where to find free sheet music, copies of recordings, and so on. When I tell them they are asking for something illegal, they act surprised and hurt. Twenty years ago software producers tried to apply copy protection schemes to thwart this very attitude. It didn't work, because other people figured out how to break the schemes as fast as they were developed. Remember "nokey.com?" (In the 8-bit days, "dot-com" meant what "dot-exe" means today.) Remember the dongle?

Interestingly, the people who ought to be most concerned about intellectual-property rights are the same ones whose attitudes about violating them are cavalier. Among my acquaintances, musicians are never reluctant to share bootleg software, and programmers are more than willing to exchange illegal copies of music.

"MP3 For Wal-Mart Shoppers"

Climbing off the soapbox and continuing my quest for MP3 knowledge, I purchased the book MP3 for Dummies by Andy Rathbone. Although the book has a 1999 copyright, relatively new even for computer books, I found it in the bargain bin at Sam's, a Wal-Mart discount outlet warehouse for the stuff they can't sell in retail stores. I guess dummies don't shop at Wal-Mart. Rathbone's coverage of the subject is pretty good and he includes a CD-ROM with lots of MP3 software and sample MP3s that I don't want to listen to. Rathbone says several times that you shouldn't use this software on laptops -- that laptop hard drives are too slow to support ripping and encoding and that the MP3s will have lots of dropout. That was not my experience. I ran the software on an old Compaq P-120 laptop and later on a new Toshiba P-466 laptop with no dropout problems whatsoever. Rathbone must have a really crappy laptop. The P-120 was slow, but the audio part worked okay. What I did encounter were software reliability problems -- not only on laptops, but on a couple of healthy desktop PCs, too.

Buggy MP3 Software

The MP3 software on the dummies' CD-ROM -- rippers, encoders, players -- is already obsolete. Software companies that support MP3 release new versions all the time. There's a reason for that. I've never seen a category of software so bug ridden. All the programs on the CD-ROM and all the upgrades of those programs that I downloaded from the Web behave irratically and consistently crash all my computers. Reboot required.

Why does commercial MP3 software crash so much? For one reason, I think the Win32 API for audio support must be flaky. I use other audio applications -- CoolEdit, Pinnacle Pro, and others -- and they all crash with some regularity. The trouble is, they don't seem to be working on the reliability problems. They keeping adding features; MP3 programs are simply too feature laden. Every such program tries to do it all -- rip, encode, playback -- and they all have intrusive Internet relationships. For example, if there is an audio CD in your CD-ROM drive, most of these programs try to go online to a web site that provides the CD's title and the titles of all its tracks. Every time. And they beat the heck out of the CD-ROM drive while they're doing it and lock the computer until they are finished. It's a neat feature, but poorly implemented.

Give Me Some Skins

Then there are "skins." For some reason users of these programs must not want to use the generic Windows user interface, so the programs have unconventional buttons and other controls that make the applications look more like cheap plastic game devices than computer programs. Apparently to cater (or pander) to the desire for individuality among users, MP3 programs also have downloadable skins, which change the look of the application with all kinds of graphical eye candy.

Feature Bloat

When software has features that add nothing to its functionality, and when that software crashes with nearly predictable regularity, I smell feature bloat, which is always conducive to the proliferation of unstable software on a platform that is unstable to start with -- and that's what you get with MP3 applications.

One such application is Winamp (http://www.winamp.com/), touted as the player to have. The version on Andy's CD-ROM works with only an occasional crash and has a really useful feature -- it supports plug-ins that change how it works. I make frequent use of digital signal processing (DSP) plug-ins that change the pitch and tempo of tunes in real time and another plug-in that lets you write the playback to disk as a WAV file. This lets me correct old recordings that are recorded at the wrong speed. Although the Winamp web site links to many such plug-ins, the latest version stopped working with the DSP plug-ins. They just don't do anything. I had to retreat to an earlier Winamp version. But the newer version is prettier to look at.

Portable MP3 Players

Based on Rathbone's reviews of portable MP3 players, I bought an RCA Lyra from Radio Shack. It comes with RealAudio Jukebox software, which also crashes consistently. I returned the Lyra after a couple of days, not because of the software crashes, but because it's an MP3 device in name only. The Lyra uses a proprietary format for compressed music files, which is incompatible with other MP3 software and devices. You can't load real MP3s into the Lyra's memory without using Jukebox to convert them, and you can't load the Lyra's converted files into MP3 systems. Jukebox imports MP3s from other sources but does not build them, not even from CDs. My interest being in the MP3 revolution, I rejected the Lyra only because it adds nothing to my understanding of MP3. I replaced the player with the original entry in the field, a Diamond Rio 300, which, after contributing to my research, became a Father's Day gift for my son-in-law, a music lover (but not an audiophile) and former disk jockey. Feeling less than complete with no MP3 player in my toy inventory, I promptly bid on and won a Diamond Rio 500 on eBay. It comes with software that...well, you know.

Why do I want one of these things besides the fact that I am a gadget junkie? At first look, they don't seem to offer much to a guy like me. After all, I listen mostly to music not likely to be found as MP3s on the Internet, and I pay for whatever music I possess. The device has 64 MB of internal memory, and I added a 32-MB Smartmedia card, which provides enough room for about two CDs worth of music. How do I use it? With the memory card, the street price is about $300. What can it do that a $50 portable CD player can't do? At the risk of sounding narcissistic I'll admit I rip and encode tapes of my own performances. Yes, I listen at great length to me -- not for entertainment, but to scrutinize and criticize my work and, hopefully, get better. MP3 lets me keep a lot of it on the hard disk. The Diamond Rio 500 lets me carry a bunch of it around in a tiny package with headphones and a convenient user interface.

Software and Source Code

You can download lots of programs from the Internet. Probably the best online resource for MP3 software and information is http://www.mpeg.org/. There you find not only links to software and source code, but information on the licensing and patents for the technology as well. Although MPEG steadfastly protects and asserts its patent rights for encoding and decoding products, it isn't enforcing those rights against people who distribute software-only decoders. Their license fees are posted, but they also link to some free encoders, which must mean that they have licensed the uncompensated distribution of encoders to those developers whose software complies with MPEG's standards.

Which presents an opportunity. With the source code in C and C++ readily available for the core encoding and decoding functions, and with a gaggle of fragile programs out there, someone should be able to build something that won't crash an operating system. Go for it. But please don't release it until it's working.

DDJ