K3b and Nero AAC

From Hydrogenaudio Knowledgebase
(Redirected from K3b and Nero AAC Guide)
Jump to: navigation, search

K3b is a multi-purpose burning/ripping/transcoding tool for Linux under the KDE graphical environment (it can be run under GNOME as well so long as the correct libraries are installed). It is generally pretty stable and does a good job of keeping the meta-data (e.g. title, album, etc) for tracks. The M4A file format is therefore well matched to be outputted from K3b.

This guide is a modified version of a post on the Hydrogen Audio forum here.

Note that this only allows you to create .M4A files (that means MP4 audio files) - it does not allow you to decode them so that they can be burnt to a CD. I recommend to rather use the M4A file extension than MP4 because it is more precise.

Requirements[edit]

(In parentheses the versions used by the author)

  • Linux (I'm using Ubuntu Intrepid Ibex 8.10)
  • K3b (1.0 or higher. Previous versions do not support the correct byte order or write wave headers.)
  • Nero Digital Audio Reference MPEG-4 & 3GPP Audio Encoder (1.3.3.0 or higher required, previous versions don't include a linux neroAacTag executable. It can be downloaded from http://www.nero.com/eng/downloads-nerodigital-nero-aac-codec.php )

Instructions[edit]

These instructions assume you have installed all the required items above.

Install Nero Digital Audio executables[edit]

This part is pretty easy. You just unzip the files to a directory somewhere. In this instruction we only need the executables in the linux directory. You might want to test out that the executables can run by doing something like:

$ ./neroAacEnc

in the linux directory of the extracted files. You should see some output like this:

*************************************************************
*
* Nero AAC Encoder
* Copyright 2008 Nero AG
* All Rights Reserved Worldwide
*
* Package build date: Sep 17 2008
* Package version: 1.3.3.0
*
* See -help for a complete list of available parameters.
*
*************************************************************

ERROR: no input file specified


Create 'neroaac' wrapper script[edit]

So I made a wrapper script around neroAacEnc and neroAacTag. The code for it is below. Copy the code into a file /usr/local/bin/neroaac. Make sure you chmod it to something like 755.

#!/bin/bash
cd /home/chris/nero/linux
./neroAacEnc -if "$1" -of "$2"
./neroAacTag "$2" -meta:title="$3" -meta:artist="$4" -meta:comment="$5" -meta:track="$6" -meta:album="$7" -meta:year="$8"

IMPORTANT: Change the line that reads cd /home/chris/nero/linux to be the directory where you have neroAacEnc and neroAacTag located. You may want to test the wrapper script by just entering neroaac in a terminal window. If everything is correct, you should get an output similar to the one above.

Just in case you are interested, this program will take in the following parameters:

  1. Source filename (or '-' for stdin).
    The data this script takes in will be RAW 16 bit, 44.1kHz, little endian, stereo and with a WAVE header. We will make sure k3b outputs the correct format later.
  2. Output filename. e.g. "myfile.m4a"
  3. Track Title
  4. Track Artist
  5. Track Comment
  6. Track Number
  7. Album
  8. Year

Configure K3b to use 'neroaac' as an External Plugin[edit]

I'll do this with the aid of some screenshots.

  1. Load up K3b and go to the 'Settings' menu and select 'Configure K3b'. Select 'Plugins' and then 'K3b External Audio Encoder'. Hit the 'Configure' button:
    Settings-configure-k3b.png
  2. In the next dialog box add a new program to the list and enter the following values in the 'Configure Plugin' box:K3b-add-external-plugin.png
    The command line here is:
    neroaac - %f %t %a %c %n %m %y
  3. Ensure you select 'Swap Byte Order' and 'Write Wave Header' so that the neroaac script gets the right format. (Note: I think k3b has this setting around the wrong way. If k3b was actually outputting little endian, neroaac-enc would work OK. Swapping the byte order seems to fix it.)
  4. Close the 'Configure Plugin' and 'Options' boxes.

Usage[edit]

You can now use the 'Convert Audio Project' to convert any files that K3b can read into .M4A files. This is the 'arrow' button in the screenshot below:

K3b-audiocd-project.png

Note that if you want all the meta tags (e.g. "Album") set, you will have to open the 'Burn' dialog for the Audio project and enter the CD Text information and then hit the "Save" button.

You will also be able to rip to .M4A by selecting your CD reader/recorder in the tree and using the following button:

K3b-ripping.png

Known flaws/limitations[edit]

  • The progress bar goes to 100% before tagging (so it takes a little bit more to really complete the work). This is because K3b judges the completeness of the operation by how much of the file it has fed to the program.
  • Does not support decoding of M4A files. This would require the development of a proper Audio Decoding plugin for K3b.
  • Note the remark above to get complete meta tags.

See also[edit]

Notes and references[edit]

External links[edit]