gutted wrote:
> I'm part way through re-ripping my CDs to FLAC.  So far as I know, I'm
> using best possible compression when ripping (I'm using EAC latest
> version).
> 
> Just wondered if there is a tool I can use - perhaps FLAC itself (?) to
> scan through the files I've already ripped and either
> 
> (a) check that compression is best possible; or
> (b) further compress any files that need it.
> 
> I'm hoping there might be a utility that I can point at my music
> directly and then just leave it running and let it churn through
> everything and give me a report at the end (either by an output txt
> file, or even a console prompt).
> 
> Do such utilities exist, and if so can anyone recommend one?

Save this script as "reflac" and make it executable:

#!/bin/bash
# Re-encode flac files if required
#
# Usage:
#
#  reflac file.flac
#
# This script checks the version of flac used to encode the specified
# file. If it is 1.1.2, it re-codes the file using the current
# version of flac installed on the system.
# It is assumed that the current flac version is later than 1.1.2
# This script was written to take advantage of the better compression
# factor available in 1.1.4

VERSION=$( metaflac --show-vendor "$1" | awk '{ print $3 }' );
if [ "${VERSION}" \< "1.1.4" ] ; then
        echo "Processing $1"
        flac --best -V --force --silent "$1"
else
        echo "Skipping $1"
fi
# -------------- end of script ------------------------

This script simply checks whether the flac file was created with flac
v1.1.4 or later (1.2.0 doesn't compress any more than 1.1.4, it's just
faster). If it wasn't it re-compresses the file using the maximum
compression option.

It can be used something like this:

    find /path/to/library -iname "*.flac" -exec reflac {} \;

It *doesn't* check if "--best" or "-8" were used if the file was created
with v1.1.4 or later, and it barfs if there are any id3 tags in the file
(there shouldn't be, but it can happen, depending on how you tag your
files).

R.

_______________________________________________
ripping mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/ripping

Reply via email to