Originally Published: Tuesday, 2 January 2001 Author: Mukund
Published to: enhance_articles_multimedia/Audio Articles Page: 1/1 - [Printable]

Using Advanced Audio Coding Under Linux

Five years old! Yes, that's when MP3 was introduced, back in the dark ages of 1996. Mukund's article today discusses what's new in applications to encode and play back MP3 Media.

   Page 1 of 1  

Let's face it. MP3 is probably the most widely used format these days for distribution of high-quality natural audio on the Internet. A number of applications are available to encode and playback MP3 media, in the form of audio CD "rippers," WAV->MP3 converters, and a huge number of MP3 players, including hardware implementations. Some people are even working on a standard for the MP3 CD.

But MP3 has had its time in the sun. In fact, more than its share of the sun. Do you know how old the MP3 format is? MP3 means MPEG-1 Audio, layer-3 compression, which is part of the ISO MPEG-1 suite, which was published in 1996. Lots of other encoding technologies have made their debut since then, some of which, such as Ogg Vorbis, are far better than MP3.

Advanced Audio Coding (AAC) is one such audio coding format, which made its debut as a part of MPEG-2, and was revised and included in the MPEG-4 specification. AAC is probably the most advanced audio encoding system in the world. To quote MP3'Tech, "Advanced Audio Coding (AAC), also known as MPEG-2 NBC represents the actual state of the art in audio coding. It is able to include up to 48 audio channels, 15 low frequency enhancement channels, 15 embedded data streams and has multi-language capability. It also offers a better compression ratio than [MPEG-1] layer-3. MPEG formal listening tests have demonstrated it is able to provide slightly better audio quality at 96 kb/s than [MPEG-1] layer-3 at 128 kb/s or layer-2 at 192 kb/s."

Freeware Advanced Audio Coder (FAAC) is an opensource GPL'd suite of tools which allow a person to use the AAC format. FAAC tools are available for both Linux and Microsoft Windows platforms. The FAAC project contains an AAC encoder and decoder, and plugins for XMMS and Winamp. The tools are easy and convenient to use, although they need more CPU power than tools for MP3. FAAC needs libsndfile to encode audio from existing formats such as WAV.

Creating AAC files using FAAC is similar to creating MP3 files. First, we create a WAV of the audio which we wish to encode. This may be a song from a CD, which can be extracted to WAV using tools such as cdparanoia. Once we have the WAV ready, we run it through faac (FAAC compressor) to compress it to AAC format. An example is shown below, where cpout000.wav - a 44kHz audio file - is encoded into AAC format. This will create a file called cpout000.aac which is the generated AAC audio.

[mukund@localhost faac]$ faac cpout000.wav
FAAC cl (Freeware AAC Encoder)
FAAC homepage: http://www.audiocoding.com/
Encoder engine version: 0.70

AAC configuration:
----------------------------------------------
AAC profile: MAIN.
Bitrate: 128kbps.
Mid/Side (MS) stereo coding: Switching (If CPE).
Temporal Noise Shaping: On.
Long Term Prediction: On.
Perceptual Noise Substitution: Off.
Header info: ADTS headers (seeking enabled)
----------------------------------------------
Encoding cpout000.wav took: 6 min, 1.44 sec.
[mukund@localhost faac]$
[mukund@localhost faac]$ ls -l
total 41660
-rw-r--r-- 1 mukund mukund 3543974 Dec 22 21:13 cpout000.aac
-rw-r--r-- 1 mukund mukund 39062060 Dec 22 21:04 cpout000.wav
[mukund@localhost faac]$

Playback of AAC audio is achieved by using popular audio player software such as XMMS and Winamp, which are well known and accepted by many users. Plugins are available for both players, which uses the faad decompression library to achieve playback.

Like several compression algorithms, a lot of the algorithms which make the AAC specification are patented, and royalties have to be paid to use them in commercial environments (see the AAC Patent License Agreement). But this may not prevent most users from using the format anyway. After all, AAC is the most advanced audio format available today. Not many bother that MP3 encoding requires royalty payments as well.

MP3 is old, and has had its time. It is important that adapt new technology as made available.

Please note that piracy and distribution of pirated high-quality audio is illegal and punishable by law in most countries. It is also ethically improper to do so.





   Page 1 of 1