Κυριακή, Νοεμβρίου 21, 2004

To compress or not? (Music)

I enjoy listening to music, as I'm sure most of you do. The whole idea of copying music to lossy compressed formats (mp3 and the like) never appealed to me, even though I spend quite a few hours in front of a computer. The reasons, briefly, are that I usually use my decent--nothing particularly fancy--stereo equipment and I can't stand the noise of the computer. The reasons why most people love mp3 are also quite clear, namely good-enough-quality, little hard disk space, "coolness" and most importantly massive ripping/downloading/sharing communities.

Recently I bought a nice set of surround (5.1) computer speakers made by Creative (Creative T5400) to use with my Audigy 2 ZS audio card. I was never satisfied with the quality of the onboard audio which, in most cases, is simply not comparable to add-on cards. Spending 60-70 $/euros on an add-on card can really make a difference, in my opinion. Especially USB versions are quite practical and are also isolated from the electrical noise and interference inside the box. I also took some steps to reduce the noise from my computing environment--a topic large enough to become an article in itself, if you are interested.

To cut a long story short, I decided that I could start listening to music from the pc while working. My network bandwidth is very low and I never got involved in this "sharing"-mania that leads other people to collect massive amounts of music. Besides, I enjoy the process of actually buying a CD from a store, looking at the covers, chatting with the salesmen and pondering my various choices. I only rip my own cd collection, a necessary step to prevent several of my favorite CDs from deteriorating over time. I also "recorded" some of my LPs for everyday listening.

I have considered various formats, I even performed my own blind listening tests with my friends. I started with a minimum acceptable of rate ~200 kbps vbr stereo. In this rate, Vorbis was the clear winner over lame. I used lame --alt-preset extreme and an oggenc -q setting that produced the approximate same bitrate. I consider lame to be an excellent choice for those that are tied to mp3 devices (mobile, car audio etc) but I wish vorbis would be more popular. Sadly it seems that the good-enough philosophy has prevailed to such an extent that most people are not willing to consider a free, open-source, superior alternative over mp3 (for those perplexed by the lame and vorbis terms, allow me to explain: vorbis is an open-source variable bit rate audio codec that has been available for a while, files are commonly called ".ogg" but .ogg is the container format, just like .avi is a container format for DivX video, lame, on the other hand, is a popular mp3 compression "engine" that is also open-source and free. You should consider lame if you are using mp3 compression). If you are using the Windows environment you can propably find the OggDS codec for vorbis audio or try the extremely powerful CDex program for ripping.

While I was considering ogg or mp3, each with its own advantages, I encountered the flac codec. Flac is lossless, it preserves all the information in the original file. Now, arguably, most people are unable to hear differences between a CD and a 320kbps mp3 file but for pedantic listeners like me there is a huge bonus in knowing that the compressed file is mathematically (i.e. bit for bit) equivalent to the original. This is especially important for archival purposes and other uses like home recordings or LP-to-digital recordings. Flac can achieve nice compression ratios (approximately 500 kbps for classical music and less than 800 kbps for most modern music) and is playable, unlike other archival formats like zip. The cost of hard disk space is so low these days that there is little purpose in using low-bitrate formats for your CD collection. In 40 Gbytes I managed to fit over 100 CDs and I can use DVD-R for thematic collections (4.7 GB disc = ~12 CDs). Most importantly, unlike lossy compression formats, flac can easily be converted to vorbis/mp3/aac or whatever you prefer in the future, for your portable device or other uses. Recompressing mp3 or vorbis files or any other lossy format is a very bad idea for several technical reasons. I have made a linux shell script (I could post this if anyone is interested) that descends directories recursively and builds medium bit-rate mp3s for my portable device from the "flac archive".

If you are planning to move your CD collection to another media (PC, notebook, DVD-R) you should consider lossless formats (of which flac is just one--albeit my favorite).

PKT