From: Bastian Dehn Date: Sat, 4 Jun 2022 17:03:32 +0000 (+0200) Subject: add: encode flac with apply replaygain option X-Git-Tag: v1.0.0^2~57^2 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=8c16422fcdeb5c06bb86b9bf917c457904ccc195;p=albentohandy.git add: encode flac with apply replaygain option --- diff --git a/albentohandy b/albentohandy index 77006c3..cedc7b8 100755 --- a/albentohandy +++ b/albentohandy @@ -142,6 +142,20 @@ ConvertFlacToOpus() | parallel --will-cite --ungroup --eta --progress FlacToOpus {} } +FlacApplyReplayGain() +{ + local readonly WORKDIR="$1" + + if [ -n "$replaygainapply" ]; then + for i in $(find $WORKDIR -name '*.flac' | sort); do + nice --adjustment=10 flac --totally-silent \ + $replaygainapply --output-name=$i-tmp $i + metaflac --remove-replay-gain $i-tmp + mv $i-tmp $i + done + fi +} + PictureToFlac() { local readonly WORKDIR="$1" @@ -413,6 +427,7 @@ ConvertProcess() elif [ $flac == true ]; then printf "\nPhase %02d of %02d: flac -> flac with cover\n" \ $((curphase++)) $phase + FlacApplyReplayGain "$WORK" PictureToFlac "$WORK" elif [ $opus == true ]; then printf "\nPhase %02d of %02d: flac -> opus\n" \