TransFLAC This utility is invoked as follows:
transflac $input-flac-dir $output-lossy-dir $lossy-codec $codec-quality transflac quit - Immediately exit transflac exit - Immediately exit transflac -h - Display HELP transflac --help - Display HELP
$input-flac-dir is the location of the base directory which contains the FLAC files which are to be processed
$output-lossy-dir is the location of the output directory where you wish to place the lossy files
$lossy-codec is the desired output lossy codec to be used to convert the FLAC files:
|OPUS||48 kbps||64 kbps||96 kbps||128 kbps||192 kbps|
|OGG||80 kbps||96 kbps||112 kbps||128 kbps||160 kbps|
|AAC||40 kbps||80 kbps||96 kbps||128 kbps||224 kbps|
|MP3||85 kbps||100 kbps||115 kbps||130 kbps||165 kbps|
If any input parameters are not provided, you will be prompted.
If you have customized options in $HOME/.transflac.conf those values will be substituted.
The utility scans the $input-flac-dir; recursively walking the structure for FLAC files. When a FLAC file is found, it's name and creation date will be checked against that of any corresponding lossy file of the specified codec in the target directory. If the FLAC file timestamp is older than that of the lossy file, processing will be bypassed. If the timestamp of the FLAC file is newer, or if no lossy file exists, then a new lossy file will be created - preserving all associated tag information.
Normal processing flow is as follows:
- src-tf-set-colors.sh is sourced to allow color display of messages.
- src-tf-set-variables.sh is sourced to set system defaults. If $HOME/.transflac.conf exists, src-tf-conf-override.sh will be sourced to apply any valid local overrides.
- src-tf-ck-input.sh is sourced to validate the $input-flac-dir. If none has been entered, you will be prompted. If no FLAC files exist in the directory structure, you will be requested to enter another directory; since no files exist to be processed. Any symlinks entered will be resolved and the physical path will be displayed.
- src-tf-ck-output.sh is sourced to validate the $output-lossy-dir. If none has been entered, you will be prompted. If no directory exists, one will be created. Any symlinks entered will be resolved and the physical path will be displayed.
- src-tf-ck-codec.sh is sourced to validate the $lossy-codec. If none has been entered, you will be prompted. Valid codecs accepted are: OPUS|OGG|AAC|MP3. Note: FFMPEG is required to transcode to MP3 or AAC formats. If you do not have FFMPEG installed, only OPUS|OGG will be shown as valid codecs.
- src-tf-ck-quality.sh is sourced to validate the $codec-quality. If none has been entered, you will be prompted. Valid quality presets accepted are: LOW|MEDIUM|STANDARD|HIGH|PREMIUM.
- src-tf-codec.sh is sourced to walk the input directory structure and transcode the FLAC files to the desired lossy codec.
- rsync is then called to synchronize any supported album art files which may exist in the $input-flac-directory to the $output-lossy-directory.