From af1c8e4503bf0c557fd352cfcb07727da9ebb785 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Fri, 20 Apr 2018 21:30:52 +0200 Subject: [PATCH] Fix mp3gain on Ubuntu 18.04. --- mp3loud_track.sh | 4 ++-- mp3loud_tracks.sh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mp3loud_track.sh b/mp3loud_track.sh index 690b00d..43ae65f 100755 --- a/mp3loud_track.sh +++ b/mp3loud_track.sh @@ -5,7 +5,7 @@ TARGET_LOUDNESS=-14 # Normalise MP3 to 89 dB, add tags to file -mp3gain -q -k -p -r -s i "$1" > /dev/null +LD_PRELOAD= mp3gain -q -k -p -r -s i "$1" > /dev/null # Find actual EBU R128 loudness, show relative to $TARGET_LOUDNESS LUFS LOUDADJUST=`bs1770gain --norm $TARGET_LOUDNESS --xml "$1" | grep -m 1 integrated | sed -e 's/^.*lu="\(.*\)".*$/\1/'` @@ -21,7 +21,7 @@ GAINADJUST=`printf %0.f $GAINADJUST` if [ "$GAINADJUST" -ne 0 ]; then echo "[$1] Adjust gain by: $GAINADJUST" # Use this call to have clipping-prevention which doesn't work when modifying gain directly - mp3gain -q -k -p -r -s i -m $GAINADJUST "$1" + LD_PRELOAD= mp3gain -q -k -p -r -s i -m $GAINADJUST "$1" else echo "[$1] No further adjustment necessary." fi diff --git a/mp3loud_tracks.sh b/mp3loud_tracks.sh index 772377f..159cde3 100755 --- a/mp3loud_tracks.sh +++ b/mp3loud_tracks.sh @@ -8,7 +8,9 @@ if [ -z "$CONCURRENCY_LEVEL" ]; then CONCURRENCY_LEVEL=1 fi +CONCURRENCY_LEVEL=1 + echo "Processing using $CONCURRENCY_LEVEL processes..." -nice -n2 find "$@" -print0 | xargs -0 -P $CONCURRENCY_LEVEL -n 1 -I {} /opt/mbirth/mp3loud_track.sh "{}" +nice -n2 find "$@" -print0 | xargs -0 -P $CONCURRENCY_LEVEL -n 1 -I {} nice -n10 /opt/mbirth/mp3loud_track.sh "{}" echo "All done."