This second part of my complete guide to digital audio covers transcoding your audio CDs. This means converting them to MP3s, AACs (for iPod) or whatever format and quality you want. Fortunately, all of the hard work has already been done and this is an easily automated task.
Once you have your music stored on your computer, you will probably want to enjoy them on other devices such as your phone or portable music player. Your car CD player might support MP3 discs (a CDR containing folders of MP3s or WMAs). You might also want to create a music "mix" CD, combining your favorite tracks
Unfortunately, the cue/flac format really isn't all that convenient (directly) for these applications. Don't worry because it is really easy to transcode your files into just about any format you wish. This is a simple task and it can all be handled by your computer with a few clicks. Converting things is what computers do best.
Finally, because we started with cue sheets and lossless flac files, we will end up with the best possible (highest quality) results.
All the Transcoding we need can be accomplished with free software, but it does require a little bit of setup. You will also need a helper script that I wrote to put everything together. The script is written in Perl and should be easy to customize if you want it to perform a different task or change it's behavior.
Before we setup the script, let me tell you what it can do. On the surface, the purpose of the script is pretty simple: Split a cue/flac album into individual tracks and re-encode them. However, there is quite a bit more to it.
- Supports CDs stored as Cue Sheets with either FLAC or Monkey's Audio
- Transcode single albums, lists of albums, or recursive folders of albums
- Uses multiple cpus (if available) to convert albums faster
- Supports (currently) 7 formats: AAC (iPhone), MP3 (portable use), MP3 (home use), Ogg Vorbis (portable use), WMA Pro (portable/car use), FLAC, and FLAC w/o HDCD decoding.
- Resulting audio tracks will be tagged appropriately
- Tracks may include embedded album art (depending upon format choice)
- Automatically detects pre-emphasis and applies de-emphassis at 24-bit resolution
- Automatically detects HDCD and decodes the audio stream to 20-bit resolution
- Supports writing to a temporary directory, or one you specify
- Allows selecting a simpler (flatter) target folder hierarchy
- Saves format & hierarchy when run multiple times to the same target folder
- Uses drag-n-drop to select folders
- Takes an argument so you can create a shortcut with a target folder
- Errors (if any) are tracked and a report is printed at the end
UPDATE: The script now has a bit better UI, an improved drag and drop interface, and takes advantage of multiple cpus. If you have a dual or quad core cpu, the conversion time should be significantly reduced!
UPDATE 6/16/20202: The script had a problem dealing with file names that contain special characters (umlaut, enya, etc.). This should be fixed now. I also increased the quality level / bit rate for portable use (mp3s only). If you don't want this, simply edit the script to tailor the conversion to suit your needs.
The main way that I use this script is that I launch it, drop the folders containing the albums and let the computer do it's thing. If the device that I want to copy the files to is directly attached to my computer, I can simply have the script write the converted audio files directly to the device. Otherwise, I put the converted files in a folder and copy them over later.
You can even use the script to convert your entire library all at once (though this may take some time!). If you run the script multiple times, it should ignore files already converted. This could be useful to keep an up-to-date MP3 conversion of your CDs. However, I don't do this and this script isn't optimized for this purpose.
Note that you can even "convert" your CDs to FLAC. What I mean by this is that it will split your CDs into separate FLAC tracks (with or without HDCD processing). Of course, "converting" from FLAC (cue sheet) to single FLAC tracks involves no loss at all audio quality. I actually use this to create mix albums (where cue sheets no longer make sense).
If this sounds like a useful tool, let me show you how to get it set up.
Step #1: Installation
In order to support all of these different formats, we need to install a few codecs and tools. Of course, if you only care about one or two formats, feel free to skip the codecs you don't care about (the script will still work). For example, if you don't want WMA, you don't need the Windows Media Encoder package or have to hassle with the patch.
Install the following software packages:
- FLAC decoder (should already be installed, or see here)
- ActiveState Perl (same as above)
- Monkey's Audio (to support cue/mac files, like cue/flac)
- Windows media encoder 9 (Note - see comments below regarding this now obsolete package)
You can get the first patch here. Extract the file "WMcmd.vbs" and replace the existing file by the same name in the folder "c:\program files\windows media encoder\encoder".
Note the comment in this page regarding Vista users needing a hotpatch. I ran into the same issue on Windows 7 and the patch worked for me.
Next, create a directory/folder called "Audiotools". In this directory, save the following downloaded files. For those files that are archives (e.g. zip files), extract them in this same directory so that they create sub-folders. These downloads are:
- A super utility called CueProc which will do all the cue file splitting for us
- SoX, a sound file processing tool (make sure it installs into the Audiotools directory
- The latest version of Lame, the MP3 encoder
- An Ogg vorbis encoder. A old, but really fast version of is here, or newer one is here.
- Nero's AAC encoder
- HDCD software decoder
- \hdcd.exe (not a directory)
Note: Cueproc expects an older AAC executable called "neroaacenc_sse2". Newever versions of Nero's encoder are named "neroaacenc". Simply copy or rename the binary (in the win32 folder) to "neroaacenc_sse2".
Finally, download a wrapper script that I wrote that manages all of the conversion for us:
UPDATE: I've changed the script to use Tk (a GUI toolkit library). Before running the script you must also install Tk and Sys::CPU. After installing ActiveState Perl, simply type "ppm install Tk" followed by "ppm install Sys::CPU" in a command window. Both Perl modules should install automatically.
Note: Unfortunately, for the latest version of perl 5.14.2, you need a workaround to get Tk. After installing Activestate Perl, type ppm in a command window. Edit preferences, then click on the Repositories tab. Finally add a named repository with the location of "http://www.bribes.org/perl/ppm". Afterwards, you should be able to install Tk normally.
Step #2: Using the script
To launch the script, simply double click on it. A window will pop-up. Drag and drop folders containing Cue files into this window.
The script will count the number of Cue files it finds as you go (and will look in sub-folders). When you are done dropping folders, click on the "Finish" button.
After you have entered all of the folders, the script will open a directory chooser and ask you where you want the converted files placed.
If you cancel the directory chooser, the script will create a temporary directory for you to use.
Next, the script will ask which format you want. There are 7 choices provided.
Finally, the script will ask what folder hierarchy you want created on the target.
Once you select a hierarchy, the conversion will begin.
At the end, if there were any errors with the album conversions, they will be reported and you must press enter to exit.
If you specified a temporary directory, the script will report the directory name to you at the end (so that you can copy the files elsewhere, burn them to a CD, etc.). The script will wait for you to press enter and then will automatically remove the directory.
- If there is HDCD or Preemphasis detected in any album, the audio will be processed prior to conversion.
- If you select FLAC conversion w/o HDCD processing, obviously no HDCD decoding will take place. This is useful if you intend the files to be played by a device that supports HDCD natively (e.g. a high-end DAC) or when playing them with SqueezeCenter.
- Your choices for format and hierarchy are saved in the target directory so that if you specify the same target twice, the script won't ask you those questions again.
- If you specify one argument to the script, it will open an explorer window using that folder (e.g. where you store your Cue / Flac files).
- If you specify a second argument to the script, it will use that folder as the destination (and won't ask).
For example: I create a shortcut to the script on my desktop called "phone-convert". The first argument to the script is where I store my cue/flac files (e.g. d:\CueFiles). The second argument is the folder in which my phone shows up at when I plug it in (e.g. f:\Music).
To convert files, I click on my shortcut and drag and drop the albums I want converted. Since the script remembers my preferences from a previous run (conversion type, hierarchy style), conversion starts immediately after I finish selecting the albums. The converted files are written directly to my phone. When the script is done, I just disconnect my phone. Simple, easy and (now) fast!