Audacity Audio Helper

Overview

Audacity

  • Audacity is an excellent free, open source, cross-platform software for encoding and editing sounds. I use it to record analog audio from my turntable, and for processing PCM tracks from audio DVDs and Bluray disks.

Exact Audio Helper

Requirements

  1. Copy tracks compressed losslessly with Audacity to my audio file server for home use. I use Audacity's FLAC codec export for this.
  2. Copy tracks compressed lossy with maximum compatibility and small file size to my audio file server for portable use. I use Audacity's LAME MP3 codec export for this.
  3. Simple and speedy copying and encoding
  4. Every exported album is processed only one time for both formats
  5. Proper meta tagging
  6. Replay Gain calculation in tags only, without modifying original compressed track file
  7. Integrate Album Art into each track file
  8. Compatible with Apple and Android portable devices

Other encoders

  • AAH is built so that you can use any 2 encoders you prefer, as long as there is an encoder meta tag executable which you can set in AAH's ini file

Installation

Ripping and tagging

  1. Download and install Audacity
  2. If you already installed Exact Audio Helper and followed the installation procedure all required executables and files are already installed.
  3. Download Audacity Audio Helper and install the zip file to a portable directory. Create a tools folder within this directory to keep the executables required to modify meta tags.
  4. Download the current 64 bit version of FLAC (as of 4 Sep 2020 this is version 1.3.2). Open the zip file and extract metaflac.exe from the win64 folder to your AAH/EAH tools folder (a folder of your choice).
  5. Download Akkurat's REACT mod, or this file react_2.0.akku.b04.zip, in case the link is not active. Open the zip file and extract metamp3.exe from the tools folder to your AAH/EAH tools folder.
  6. Download and install ImageMagic. There are many different versions available, you may choose to download a zip file without installer. Choose the Portable Win64 static at 16 bits-per-pixel component, you won't need HDRI. As of 4 Sep 2020 this is version 7.0.10-28. Open the zip file and extract convert.exe to your EAH tools folder.
  7. Download and install the current 64 bit version of Album Art Downloader, as of 4 Sep 2020 this is version 1.0.5. Album Art Downloader needs the .NET 3.5 Framework to run, which you might need to install first.

Trouble shoot encoder settings

Mp3tag

Mp3tag is a powerful meta tag viewer and editor. Despite it's name it supports many different audio file formats:

  • Advanced Audio Coding (AAC)
  • Apple Lossless Audio Codec (ALAC)
  • Audio Interchange File Format (AIF / AIFC / AIFF)
  • Direct Stream Digital (DSF)
  • Monkey's Audio (APE)
  • Free Lossless Audio Codec (FLAC)
  • Matroska (MKA / MKV)
  • MPEG Audio Layer 3 (MP3)
  • MPEG-4 (iTunes® compatible MP4 / M4A / M4B)
  • Musepack (MPC)
  • Ogg Vorbis (OGG)
  • IETF Opus (OPUS)
  • OptimFROG/OptimFROG DualStream (OFR/OFS)
  • Speex (SPX)
  • Tom's lossless Audio Kompressor (TAK)
  • True Audio (TTA)
  • Waveform Audio File Format (WAV)
  • WavPack (WV)
  • Windows Media Audio (WMA)

mid3v2

mid3v2 is part of the Mutagen package which allows detailed analysis of MP3 meta tags.

  1. Install Python. Go to the Microsoft Store, search for “python”, and install Python 3.8. Check that it has properly installed with:
    powershell python --version
  2. Install Mutagen with:
    powershell python -m pip install mutagen
  3. There will be a warning that the script directory is not in your path, so Windows cannot find the executables automatically. It will display something like “C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts”
  4. Add this path to your user's environment, so you don't need to type the full path everytime you need to run mid3v2.exe. Open Windows' Start Search, type “env”, then choose “Edit the system environment variables”, and click the “Environment Variables…” button at the bottom.

Music player

  • Windows: Install foobar2000. It plays flac and mp3 files, and gives you comprehensive meta tag information on both formats.

Configuration

Configuration of AAH is very flexible and can be adjusted to your EAC/EAH configuration. I have included my own setup in the walk through below, which adds proper meta tags, the album art image, and replay gain to each extracted track for mp3 and flac. AAH is configured completely independently from Audacity, and does not modify any Audacity settings or the registry.

Audacity Configuration

There is no specific audacity configuration required, but you need to pay attention to the export options when exporting the tracks, which is explained in the Work flow section.

MP3 Configuration

  • I found metamp3.exe to be the best tool to modify mp3 meta tags. The configuration options for mp3 are in the AAH.ini file, all entries are explained with some remarks.
  • For AAH you need to configure mp3 track meta tagging for individual tracks, and for albums. Recommend track and album tagging options:
    MetaOptTrack=--2 --artist "%artist%" --album "%albumtitle%" --year %year% --track "%tracknr1%/%numtracks%" --genre "%genre%" --frame TPE2:"%albumartist%" --frame TPE3:"%albuminterpret%" --frame TPOS:"%cdnumber%/%totalcds%" --frame TCOM:"%composer%"
    MetaOpt=--2 --replay-gain --frame APIC{3}:"%workspace%\%coverfile%" --comment "%comment%" --frame TENC:"%username%" "%workspace%\*.mp3"
  • See the Configuration walk through for details on Audacity configuration and encoded track export

FLAC Configuration

  • For AAH you need to configure flac track meta tagging for individual tracks, and for albums. Recommend track and album tagging options:
    AddMetaOptTrack=--set-tag=ARTIST="%artist%" --set-tag=ALBUM="%albumtitle%" --set-tag=DATE=%year% --set-tag=TRACKNUMBER=%tracknr1% --set-tag=TOTALTRACKS=%numtracks% --set-tag=GENRE="%genre%" --set-tag=ALBUMARTIST="%albumartist%" --set-tag=PERFORMER="%albuminterpret%" --set-tag=DISCNUMBER=%cdnumber% --set-tag=TOTALDISCS=%totalcds% --set-tag=COMPOSER="%composer%" --show-tag=TITLE
    AddMetaOpt=--add-replay-gain --import-picture-from="%workspace%\%coverfile%" --set-tag=COMMENT="%comment%" --set-tag=ENCODED-BY="%username%" --show-tag=TITLE "%workspace%\*.flac"
  • See the Configuration walk through for details on Audacity configuration and encoded track export

Character Replacements in file names

  1. AAH will check that all file names adhere to rules imposed by the OS how files can be named. These rules should be the same as the ones defined for EAC.
  2. Make sure you add replacement rules in the ini file, if you are not using EAC, or if you are using a version of EAC which does not keep the replacement rules in the same registry setting as EAC v1.5 does.
  3. If EAC's replacement rules are accessible in the registry, those are used if not defined in the ini file. See additional information in Exact Audio Helper for Exact Audio Copy v1.5 - EAC Options

Place holders

EAH and AAH use the same place holders as EAC does. This table explains the place holders, and where they are available. You can use them for file names and other options where reference to album and track information is required.

Place holder Explanation EAC EAH AAH
Place holders available in EAC only
%source% source filename T - -
%dest% destination filename T - -
%original% original filename (without temporary renaming) T - -
%ishigh% text between 2 such place holders only when “High quality” selected A - -
%islow% text between 2 such place holders only when “Low quality” selected A - -
%haslyrics% text between 2 such place holders only when lyrics exist T - -
%hascover% text between 2 such place holders only when storing cd cover is enabled and cover exists A - -
%crcenabled% text between 2 such place holders only when “CRC checksum” selected T - -
%tracklen% track duration T - -
%lengthmin% track duration (minutes part) T - -
%lengthsec% track duration (seconds part) T - -
%cddbtype% freedb music type A - -
%cddbid% freedb ID A - -
%lyrics% lyrics T - -
%lyricsfile% filename of lyrics text file T - -
%trackcrc% CRC of extracted track T - -
%bitrate% selected bitrate A - -
Place holders available in EAH and AAH
%tracknr% track number (same as %tracknr2%) T - T
%tracknr1% track number (at least 1 digit) T - T
%tracknr2% track number (at least 2 digits) T - T
%tracknr3% track number (at least 3 digits) T - T
%numtracks% number of tracks on CD/album A - A
%cdnumber% number of the CD A A A
%totalcds% total number of CDs in the given CD set A A A
%title% track title T - T
%artist% track artist T - T
%genre% music genre A A A
%year% year A A A+T
%composer% track performer T - T
%albumtitle% CD title A A A
%albumartist% CD artist A A A
%albumcomposer% CD composer A A A
%albuminterpret% CD performer A A A
%comment% comment A A A
%coverfile% filename of CD cover image A A A
%workspace% working folder for temporary files - F F
%scriptdir% directory the script is run from - F F
%username% current user logged in to windows - A A
%today% today's date - A A

Scope: A=album, T=track, F=folder, -=not available. In AAH %year% is replaced with the year indicated for each track, if a track_artists.txt file exists and the year is specified for the track, replaced with the “album” year taken from the GUI otherwise.

Work flow

  1. You should always make sure that your workspace (the extraction directory) is empty before you start a new session.
  2. Start Audacity and import your wav file into the project.
  3. Set a Label at the correct start of each track. If you know the track start positions, for example from a chapter file taken from a DVD audio file, chose menu Edit –> Labels –> Edit Labels…. Chose the song name as label, without any preceding track number.
  4. Set the end Label positions for each track with Edit –> Labels –> Edit Labels… to the start of the following track.
  5. Once done, export all tracks with File –> Export –> Export Multiple…. Do not add any meta tags except the track names, which are already added through the labels.
  6. For MP3 export, select “MP3 Files” as format, select your workspace directory as “Folder”, set Bit Rate Mode to “Variable”, Quality to “145-185 kbps” which is equivalent to LAME MP3 option -V4 (medium quality), Variable Speed to “Fast”, Channel Mode to “Joint Stereo”, Split files based on “Labels”, and Name files to “Numbering before Label/Track Name”. Export.MP3 Export
  7. For maximum compatibility of MP3 encoded files set the “Project Rate (Hz)” at lower left corner of the Audacity window to 44100 before exporting MP3. This is the bitrate used for audio CDs.
  8. For FLAC export, select “FLAC Files” as format, select your workspace directory as “Folder”, set Level to “8 (best)” which is equivalent to FLAC option -8 (best quality), Bit depth to “16 bit”, Split files based on “Labels”, and Name files to “Numbering before Label/Track Name”. Export. FLAC Export
  9. For audio which was captured from vinyl or tape I use a bit depth of 16 bit and a bit rate of 44100 Hz, which is equivalent to the quality settings for CDs. Since the audio was post processed after capture this should be sufficient to get audio quality similar to a CD copy. Check out my Extract tracks from LP (Vinyl Records) work flow for instructions how to capture analog audio.
  10. For audio which was copied from DVD or BD (Bluray Disc) I usually use the source settings, for example bit depth of 24 bit and bit rate of 48000 Hz. In this case you should make sure the “Project Rate (Hz)” at lower left corner of the Audacity window is set to the source bit rate. Most audio players which are capable of playing FLAC encoded files can handle files encoded with such settings, but I recommend to test all your players you intend to use to play FLAC encoded files before you start exporting. Bear in mind that 24 bit FLAC vs 16 bit FLAC will double the file size.
  11. Start AAHAAH
  12. If you have a Multi-CD album, set Number of CDs and CD Number first.
  13. If you have a Compilation CD, set the Various Artists checkbox. The CD Artist field will be replaced with the string for Various Artists as set in AAH.ini. In case you have a Compilation CD but you want to assign a main artist to this CD, this is possible too. In this case, set the checkbox, then overwrite the CD Artist field with the main artist.
  14. After having set the Various Artists checkbox the track_artists.txt file is opened with Windows' built-in Notepad, where you can enter track artist, track composer, and track year. The format is “01 Track artist//Track composer**2020”, the number at the beginning of the line identifies the track and must be in the range of 01-999. “//” is used as separator between artist and composer and cannot be part of artist or composer name. If you do not need a track composer, omit the slashes and text after the slashes. “**” is used as separator for the year in 4 digits at the end of the line and can be part of artist or composer name unless it's at the end of the line followed by 4 digits. If you do not need a track artist, remove the entire line for that track.Track artists
  15. This method can also be used for a CD where you need to enter track artists and track composers, but which is not Compilation CD. In this case, select the Various Artists checkbox, and enter the information in the artist file. After saving the file, rename the “CD Artist” back to the artist you had before selecting the checkbox, but do not uncheck the Various Artists checkbox. Any track which is not listed in the artist file will take the CD Artist for the track artist, and the CD Composer for the track composer. You can add up to 999 tracks in track_artists.txt. Use this method to add different release years to the tracks, for example for a Greatest Hits album.
  16. Select Tag tracks or Shift-F5. This will add the same tags like in EAC's built-in function Action –> Copy Selected Tracks –> Compressed… or EAH's menu Encode –> Copy & encode tracks, if you follow my Configuration recommendation as described here for AAH or for Exact Audio Helper for Exact Audio Copy v1.5AAH Menu
  17. If you have a Multi-CD album, select Encode –> Multi CD file rename. I prefer to have all music files in one directory for multiple CD albums, rather than having them split into different album names. All tracks which are not renamed yet will be renamed with the CD Number in front of the file name. For example, file “01 First track.mp3” becomes “1-01 First track.mp3”. This is necessary to separate the tracks from the different CDs in the set. The file rename does not affect track naming.
  18. Select Encode –> Get album art or Shift-F9 to open AlbumArtDownloader.exe, find a cover file, and save it to the work space. If a jpg image file already exists in work space, or in the “AlbumArtPath” (which is in AAH.ini settings), then this step is not necessary and can be skipped.
  19. Finally, select RG & Cover Art & file tracks or Ctrl-F9 to compute replay gain, add the cover art image file to each track, add the comment as set in the AAH.ini file, and move all tracks to the folder for encoded tracks as set in AAH.ini. It is easy to organize your music into a structure like “flac/artist name/album name” or “mp3/artist name/album name”.

Trouble Shooting / Limitations

Trouble Shooting

  1. Use Verify Audio Helper (VAH.exe) to make sure your destination folders are in sync, if you use 2 encoders. There is no separate help file, but the app is self explanatory, and the settings in the ini file are simple.
  2. Set $debug = 1 in the source file and run in from within the AutoIt environment

Limitations

  1. Track names cannot start with 2 or 3 digits followed by a space, because this is the format the track files are saved with (track number - space - track name).
  2. Track names cannot start with 1 or 2 digits followed by a hyphen and 2 or 3 digits, if the track is part of a MultiCD when tagging.
  3. If a track name contains more than 1 dot before the extension (e.g. Even in the Quietest Moments….mp3), then all but 1 dot are removed, because metamp3.exe cannot handle it. The resulting file name would be something like 01 Even in the Quietest Moments.mp3. This does not apply if the multiple dots are in the middle or at the beginning of the track name.
  4. AAH supports maximum 999 tracks per album
  5. Illegal file name characters are removed from the track file name and the track title in the meta tags. Illegal characters are defined in EAC or in the ini file, see Character Replacements in file names. You need to add character ’ to that list, which metamp3.exe cannot handle. There might be more characters metamp3.exe cannot handle, which I did not find yet. You can find them when you observe the output after invoking function “RG & Cover Art & file tracks” and check the total files processed. If that number is lower than the number of tracks in EAC check which file does not get processed by metamp3.exe.

File names are usually equivalent to the track (music) titles. AAH constructs the track title in the meta tags from the file name, so here is how to deal with these limitations:

  1. Remove the space between the 2 or 3 digits and the rest of the file name in Audacity when you create the labels, which later become file names. If the file name is only digits, add a letter right after the digits. Complete tagging and moving all tracks to the destination folder, then modify the title tag of these files manually with Mp3tag.
  2. Remove the hyphen between the digits. Complete tagging and moving all tracks to the destination folder, then modify the title tag of these files manually with Mp3tag.
  3. You do not need to remove the dots from the file name, as AAH will do it anyway. However, note that the track titles will not contain those dots either. Complete tagging and moving all tracks to the destination folder, then modify the title tag of these files manually with Mp3tag.
  4. Separate the files into more than 1 folder, tag them one by one, and then combine the files back into one album by renaming the files in the folder like a MultiCD album.
    1. Use folder 1 as work space, select a MultiCD setup (e.g. CD 1 of total 2 CDs), then tag all files with AAH and move them to the destination folder.
    2. Do the same for folder 2, 3, etc., set the CD number before tagging.
  5. Illegal file name characters need to be added manually to the meta tags.