This Perl script uses lame, flac, aac and ogg vorbis command line encoders (see http://www.rarewares.org) to generate encoded albums from a directory of ".wav" files using an "info.txt" file to specify the id3 tag information. It will also deflac a directory of ".flac" files or decode a directory of ".mp3" files back into .wav files. Currently I am using the following encoder versions:
lame v3.99.5
flac v1.3.1
faac v1.28
oggenc2 v2.88
This script launches the encoders in multiple simultaneous threads to take advantage of the speed of a multi-core processor. This script assumes the existence of the files "info.txt" and "cover.jpg" in the parent directory of the directory from which the script is run.
"info.txt" has the following format:
Artist: Dream Theater
Album: Six Degrees Of Inner Turbulence
Year: 2001
Genre: Progressive Metal
*
01 The Glass Prison
02 Blind Faith
...
"cover.jpg" should contain the album artwork image.
Using the "-A" switch track names in the format "artist - trackname" may be substituted, for use in compilations with multiple artists per album. "VariousArtists" should then be used for the "Artist:" field in "info.txt". "VariousArtists" will then automatically be used as the ALBUMARTIST (TPE2) id3 tag andeach track will be tagged with a different artist (extracted from the tracknames as above). The album will also be tagged as a compilation (TCMP). This will operate automatically as if the "-B" and "-K" switches had beenspecified. When imported into iTunes such albums will correctly appear in the "Compilations" section when the music library is viewed by artist.
For a complete description of this script's functionality please see the help text generated by:
encode.pl -h
This script requires the "threads" & "File:Copy" Perl modules. It also requires the lame, flac, faac & oggenc2 command line encoders. For smooth operation the directory containing this Perl script and the directories containing the lame, flac, faac & oggenc2 executables should all be in the "Path" system environment variable. This script was written for the Windows 7 environment using ActiveState Perl v5.12.4 but should be adaptable for Unix or MAC OS with a minimal amount of modification. The only things that don't work the way I wanted them to is that oggenc2 doesn't support image files and faac doesn't support the albumartist tag. I have to add those manually afterward with Mp3tag (http://www.mp3tag.de/en/). Various specific operations may becustomized to suit your specific needs simply by editing the values specified in the global constants section at the beginning of the code.
I wrote this script to generate tagged mp3 and flac files from wav files that I had digitally recorded and processed from LP records and cassette tapes. I have over 600 LP records so I have a lot of files to process efficiently. The generated mp3 files are then loaded into my iTunes library and the 24-bit flac files are loaded onto my file server where I can play them in full 24-bit lossless resolution with my Cambridge Audio CXN network player. I can then have access to my entire collection of albums from my stereo system. If you find this script helpful to you please drop me a line to the e-mail below.
Paul Rolan Perkes
paul@perkes.com
2016-11-27
[Example 1] - Encoding To flac, mp3 & aac With Default Settings
[Example 2] - Encoding A Compilation