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

index e964d241f76539022c0e0d4e5e5ca19dddab7bff..68120921d74580568142a38bcbc68831acf47276 100755 (executable)
@@ -168,8 +168,14 @@ ReadFlacToOggTags()
        local readonly OUTPUFILE="$2"
        local readonly COVERFILE="${INPUTFILE%/*}/cover.txt"
 
-       metaflac --export-tags-to=- $INPUTFILE \
-               | vorbiscomment --commentfile - --write $OUTPUTFILE
+       if [ -z "$replaygainapply" ]; then
+               metaflac --export-tags-to=- $INPUTFILE \
+                       | vorbiscomment --commentfile - --write $OUTPUTFILE
+       else
+               metaflac --export-tags-to=- $INPUTFILE \
+                       | sed '/REPLAYGAIN/d' \
+                       | vorbiscomment --commentfile - --write $OUTPUTFILE
+       fi
 
        if [ -f $COVERFILE ]; then
                echo "METADATA_BLOCK_PICTURE=$(base64 --wrap 0 $COVERFILE)" \
@@ -182,7 +188,8 @@ EncodingFlacToOgg()
        local readonly INPUTFILE="$1"
        local readonly OUTPUTFILE="$2"
 
-       nice --adjustment=10 flac --silent --stdout --decode "$INPUTFILE" \
+       nice --adjustment=10 flac --totally-silent --stdout --decode \
+               $replaygainapply "$INPUTFILE" \
                | nice --adjustment=15 oggenc --quiet --quality 6 \
                --output "$OUTPUTFILE" -
 }