Pages

Install FAAC in Ubuntu 11.04 - AAC Audio Encoder for GNU/Linux

AAC is a very popular audio compression format (codec) that was developed/funded by several famous companies such as Nokia, Dolby, Sony and Bell Laboratories (few to mention). That information alone should be enough to give you the impression that AAC is not an open-source codec ;-), although some portions of the project is licensed under GNU/GPL, nonetheless.

But the rest assured, it's efficient and especially under low bitrates, AAC codec will give much better quality outputs when comparing with the MP3 format. It is actually widely used by Apple (in almost all of their products such as iPhone, iPod-touch, etc) and various other electronic manufacturers all around the world. 

Unlike with MS Windows or Mac OSX, it's actually really hard trying to find a decent AAC encoder for GNU/Linux. Don't get your hopes up so high, because after doing some search, I've only come up with a command line tool :/. If you know any better utility, I'll be more than happy to hear about it.


It's called "FAAC". And with it you can only use WAV and Raw PCM files to convert into the proprietary AAC lossy audio format.

And on the other hand, encoding a MP3 file to AAC for instance, is pretty much useless since it actually "defeat" the purpose because, MP3 is a lossy format thus valuable "information" is already lost once you convert something into MP3, so you won't be able to get the desired results by re-converting them into the AAC nonetheless.

But there are applications that can convert MP3 to AAC, anyhow.

First install FAAC in Ubuntu 11.04 Natty Narwhal by using the below command.
sudo apt-get install faac
A Simple FAAC guide :).

You can read its manual, which explains almost everything by using the below command.
man faac
But for a quick wrap up :) let me give a basic example. Say that you have a .wav file called "1" in your Home folder that I need to convert into AAC format. Then I'd use a command similar to below one.
faac -b 96 1.wav -o new.m4a

The "-b" attribute defines the desired audio bitrate, so depending on your needs you can replace it with values within the range of - 12 kbps to 600kbps. The "-o" defines the output file, so you can replace the "new" with any name you like but make sure to use ".m4a" or ".mp4" as the extension.

You can use multiple attributes as well.

Say that you wanted to change the audio channels (default - 2, stereo) to 5 and the sample rate to 22100, which are among the main needs when it comes to encoding audio in general other than the above mentioned bitrate, then I'd use a command as below.

An example...

faac -b 96 -C 4 -R 22100 1.wav -o new.m4a
As you can see, the "-C" is used to change the desired audio channels (which is 4 in this example), "-R" is used to change the sample rate (in Hz), I've already talked about the "b"... :D. So that's about it actually. And if you have questions, then as mentioned above, I highly advice you to read the manual, that's where I got all those "tips" ;-).

Although this cannot be recommended for batch audio to AAC encoding since it won't be easy to put command after command for multiple files... but for everyday use, this is pretty handy nonetheless. Good luck. 

No comments:

Post a Comment