My favorites | Sign in
Project Logo
             
Search
for
Updated Sep 13, 2008 by kerry.j.mitchell
Labels: Featured
Documentation  

Copyright (c) 2008 Kerry Mitchell

Released under the GNU Lesser General Public License Version 3 (LGPLv3)

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:

If the Y value is used, the script will check the number of processors, if it detects only one the script will process normally. If more that one processor is detected, multi-processor mode will be used.
In multi-processor mode, the initial window will process the directory/file list/file only, no actual file processing. The script will spawn 1 additional script for each processor with the same initial command line that was used to run the program. Each of these "child" processes will actually process the file. If a child process fails, it will be detected and restarted. This process uses files in the Temp directory to pass information back and forth betweem the running scripts.

A little discussion on the other command line/config file parameters: HELP Only valid on the command line, will display a list of valid parameters

PAUSE Valid on the command line with no value (just -PAUSE), or in the configuration file on a line by itself. This will cause the program to pause after execution rather than just exiting.

LOGDIR If this parameter is used, it should be the first command line argument or first entry in the config file. The log directory to be used. This parameter can include variables (internal variables and Commnd Line/Config File properties). These variables should be included inline surrounded by % (percent) signs or ^ (carats). In addition to the normal variables, the following may also be used:

For example, given a script (D:\Re-FLACer\Re-FLACer.vbs) run in MP3 mode with a start date/time of January 2, 2008 at 3:45:05 PM and a LOGDIR of %SCRIPTDIR%\%DATE-YYYYMMDD HHMISS%-%MODE% or ^SCRIPTDIR^\^DATE-YYYYMMDD HHMISS^-^MODE^, the log directory would be:

D:\Re-FLACer\20080102 154505-MP3

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.

SYNCHRONIZE If this flag is set to Y then all files that are encoded or decoded will have the file modified date set to that of the original file. If the file dates and times are equal, the file will be skipped.

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:

COPYFILEMASKS This parameter will contain a pipe (|) delimited list of file masks that should be copied to the TARGETDIR. You can specify the fill filename, or a standard DOS mask that includes the ? or * wildcards. The mask will be applied regardless in a case-insensitive manner. For example, to copy the folder image and any log files, you would use a COPYFILEMASKS=folder.jpg|*.log

FLAC Related

This is a pipe (|) delimited list of sources that should be used when encoding from FLAC to MP3. The list is in the format type:value. The type can be either File or FLAC:
Examples: This example includes the last 2 subfolders and the filename
TagMask=%Artist%\%Album%\%TrackNumber% %Title%
This example includes all of the tag information in the filename
TagMask=%Genre%-%Artist%-%Album%-%TrackNumber% %Title%

Lame Related

Tag Related

MetaMP3

==imgResize== (Now included in the executable)

The following files all reside in the script directory, and are written to based on the associated KEEP parameter

External Programs

This program is just a wrapper around functionality available in other programs. It makes use of the following executables:

  • Lame v3.97
  • LAME is an MPEG Audio Layer III (MP3) encoder licensed under the LGPL. It can be downloaded from http://lame.sourceforge.net

Tag Mapping

This file will be used to map FLAC tags to MP3 frames. The following web pages contain information about the available tags:

The first field in the file is the FLAC tag, the second field is the MP3 frame, and the final the information that be added to the beginning of the tag. The first and second field are separated by an equal sign (=), the second and third field is separated by a carat (^).

Thanks

I 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.

DISCLAIMER: This software is provided by the author "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.


Comment by paulgjackson, Nov 04, 2009

To get Reflacer to work successfully on Windows 7 64-bit, I had to change the reflacer.exe object to XP SP3 compatibility mode (right click object, then properties)


Sign in to add a comment
Hosted by Google Code