diff --git a/mp3lame.sh b/mp3lame.sh index a0b0e05..c084c5d 100755 --- a/mp3lame.sh +++ b/mp3lame.sh @@ -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."