]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add: encode mp4 with apply replaygain option
authorBastian Dehn <hhaalo@arcor.de>
Sat, 4 Jun 2022 16:23:01 +0000 (18:23 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 4 Jun 2022 16:23:01 +0000 (18:23 +0200)
albentohandy

index 68120921d74580568142a38bcbc68831acf47276..77006c36b25892b9859a13f5b473b3cba92499eb 100755 (executable)
@@ -66,12 +66,15 @@ ReadFlacToMp3Tags()
        --title=\"$TITLE\" \
        --album=\"$ALBUM\" \
        --genre=\"${GENRE:-12}\" \
-       --track=\"${TRACKNUMBER:-0}\" --recording-date=\"$DATE\" \
-       --user-text-frame=\"$RRL\" \
-       --user-text-frame=\"$RTG\" \
-       --user-text-frame=\"$RTP\" \
-       --user-text-frame=\"$RAG\" \
-       --user-text-frame=\"$RAP\""
+       --track=\"${TRACKNUMBER:-0}\" --recording-date=\"$DATE\""
+
+       if [ -z $replaygainapply ]; then
+               local eyed3Command="$eyed3Command --user-text-frame=\"$RRL\" \
+               --user-text-frame=\"$RTG\" \
+               --user-text-frame=\"$RTP\" \
+               --user-text-frame=\"$RAG\" \
+               --user-text-frame=\"$RAP\""
+       fi
 
        # add cover picture to command
        if [ -f $INPUTFILEDIR/cover.jpg ]; then
@@ -92,7 +95,8 @@ EncodingFlacToMp3()
        local readonly OUTPUTFILE="$2"
 
        # stream flac into the lame encoder
-       nice --adjustment=10 flac --silent --stdout --decode "$INPUTFILE" \
+       nice --adjustment=10 flac --totally-silent --stdout --decode \
+               $replaygainapply "$INPUTFILE" \
                | nice --adjustment=15 lame --silent \
                -b 192 --noreplaygain - "$OUTPUTFILE"
 }