Here's the document I typed up about the functionality:
---
Re-FLACer v1.0
Purpose:
I had a need. I wanted something that could help me handle my FLAC
library. Verify that the files were not corrupt, Re-Encode them if a
new version of FLAC came out that had better compression, decode them
back to a WAV file, or allow me to easily convert to MP3s for portable
devices.
I considered a VB GUI app, possibly a VB console app... but decided that
I wanted the freedom of a VB Script. The code isn't compiled, and if I
need something for a special situation, this provides an easy way to
modify the code.
There are other applications out there, probably with more features, but
for simplicty and ease of use, I rolled my own.
Basic use:
You set up a config file with the values you want to use, and then run
the program (optioanlly with command line parameters).
Some of the required information is:
Mode
The program can be run in one of the following modes at a time:
Encode - The program looks for .WAV files and will encode them
using .FLAC
Decode - The program looks for .FLAC files and will decode them to
.WAV
MP3 - The program looks for .FLAC files, intermediately decodes
them to .WAV, then uses lame to encode the .WAV to .MP3
and removes the .WAV file
ReFLAC - The program looks for .FLAC files and re-encodes them to
.FLAC
Test - The program looks for .FLAC and tests the files for
validity
Input
There are three choices (only 2 have been coded thus far)
Directory - Command Line Parameter DIR. If used, the program will
look in this directory and all subdirectories for
files and perform the Mode action on those files
File List - Command Line Parameter FILELIST. formatted as 1 file
per line with full path and filename, the program will
iterate through each file and perform the mode action.
File - Command Line Parameter will be FILE. As this is the
least important option for me, it hasn't been coded
yet. It will allow the program t act on an individual
file.
A little discussion on the other command line/config file parameters:
CONFIG
The program always expects a configuration file (Re-FLACer.cfg) to be
present in the script directory. This config file is read first, then
any command line options are processed in the order they appear on the
command line. You can load another config file from the command line
that can override any values that exist in the original config file, or
appear on the command line earlier than the CONFIG parameter.
LOGFILENAME
The program will log all of it's information to the LOGFILENAME in the script directory
TARGETDIR
If this parameter is left blank, the action will occur the the original
file's directory. If this value is populated, the resulting directory
(if any) will be determined based on the type of Input:
Directory - The Original directory will be replaced by TARGETDIR as
the root, any subdirectories in the Directory will be
created in the TARGETDIR.
File List - The root directory of the file in the list will be placed
in the TARGETDIR. For example, given the file:
X:\Music\ZZ Top\Greatest Hits\Legs (Remix Version).flac
And a TARGETDIR of G:\Target, the file will be placed in:
G:\Target\Music\ZZ Top\Greatest Hits\Legs (Remix Version).flac
File - The file will be placed in the TARGETDIR
FLAC Related
FLACPROGRAM
The full path and filename to flac.exe
METAFLACPROGRAM
The full path and filename to metaflac.exe
VERSIONSKIP
Skip the file for processing if the version of the FLACPROGRAM is the
same as the version of the FLAC file being processed.
Tag Related
TAGPROGRAM
The full path and filename to tag.exe
REMOVEID3V2
If this has a value of Y, ID3v2 tags will be removed prior to the
operations. This only occurs if the TARGETDIR parameter is left
blank.
Lame Related
LAMEPROGRAM
The full path and filename to lame.exe
LAMEPARAMETERS
The lame parameters that should be used when encoding to MP3
The following files all reside in the script directory, and are written
to based on the associated KEEP* parameter
COMPLETEDLIST (KEEPCOMPLETED=Y or N)
The list of files that were processed successfully
ERRORLIST (KEEPERROR=Y or N)
The list of files that did not complete
SKIPPEDLIST (KEEPSKIPPED=Y or N)
The list of files that were skipped because of the VERSIONSKIP
parameter.
External Programs
This program is just a wrapper around functionality available in other
programs. It makes use of the following executables:
FLAC v1.2.1
Makes use of flac.exe and metaflac.exe, these programs can be obtained from
http://flac.sourceforge.net/ on the Download page, click on the link to
download FLAC for Windows (command-line tools only).
Tag v2.0.52
Makes use of Tag to identify and remove ID3v2 tags. This program can be
obtained from
http://synthetic-soul.co.uk/tag/ Lame v3.97
LAME is an MPEG Audio Layer III (MP3) encoder licensed under the LGPL.
It can be downloaded from
http://lame.sourceforge.netI also wanted to thank Synthetic Soul (http://www.synthetic-soul.co.uk/)
for his work on flac-113.bat, and the other related batch files. They
helped me determine what I wanted the script to do.
---
I don't really have a place to host this code, and it looks like I can't add an attachment to this post. I can post the VBScript and the config file in code sections, but don't think that's the best option. Is anyone aware of a place I can post the ZIP file (it's only about 10K).