Rewrote mp3lame.sh to use multi-processing.

This commit is contained in:
Markus Birth 2013-09-09 00:52:08 +02:00
parent 4aeb18b7d8
commit 8c7e1f3e27

View File

@ -4,9 +4,11 @@ if [ "$#" = "0" ]; then
exit 1
fi
while [ "$#" -gt 0 ]; do
echo "Processing $1 ($# more left)..."
#lame -m j --replaygain-fast --preset extreme -q 2 --vbr-new -V 2 -o --id3v2-only "$1" "$1.mp3"
lame -m j --replaygain-fast --vbr-new -V 2 -o --id3v2-only --resample 44.1 "$1" "$1.mp3"
shift
done
if [ -z "$CONCURRENCY_LEVEL" ]; then
CONCURRENCY_LEVEL=1
fi
echo "Processing using $CONCURRENCY_LEVEL processes..."
find "$@" -print0 | xargs -0 -P $CONCURRENCY_LEVEL -n 1 -I {} lame -m j --replaygain-fast --vbr-new -V 2 -o --id3v2-only --resample 44.1 --quiet "{}" "{}.mp3"
echo "All done."