Hi,

Having recently installed flac v1.1.4, I thought it would be a good idea
to re-process all my flac files to take advantage of the increased
compression.

I wrote the following "script" (it's not very complicated!) to check the
version of flac used to encode  a flac file and only process it if
v1.1.4 was not used.


#!/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


This script can be used something like this:

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


I hope someone finds it useful.

R.

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

Reply via email to