]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change formatting encode methods
authorBastian Dehn <hhaalo@arcor.de>
Sun, 30 Aug 2026 08:39:57 +0000 (10:39 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 30 Aug 2026 08:39:57 +0000 (10:39 +0200)
libs/mp3.sh

index 8c6c8096cddbe14e630bb8730c2f8ff2dc8d72e1..ab63328f2f25f29518b8de800a498d81ba2346ab 100644 (file)
@@ -78,30 +78,33 @@ read_flac_to_mp3_tags()
 
 encoding_flac_to_mp3()
 {
-       local inputfile="$1"
-       local outputfile="$2"
+       local input="$1"
+       local output="$2"
+       BITRATE=${BITRATE:="192"}
 
-       nice --adjustment=10 flac --totally-silent --stdout --decode \
-               "$inputfile" \
-               | nice --adjustment=15 lame --silent \
-               -b 192 \
+       nice --adjustment=10 flac \
+               --totally-silent \
+               --stdout \
+               --decode \
+               "$input" \
+               | nice --adjustment=15 lame \
+               --silent \
+               -b "$BITRATE" \
                --noreplaygain \
-               - "$outputfile"
+               - "$output"
 }
 
 flac_to_mp3()
 {
-       local inputfile="$1"
-       local outputfile="${inputfile/.flac/.mp3}"
-
-       encoding_flac_to_mp3 "$inputfile" "$outputfile"
-       read_flac_to_mp3_tags "$inputfile" "$outputfile"
+       local input="$1"
+       local output="${input/.flac/.mp3}"
+       encoding_flac_to_mp3 "$input" "$output"
+       read_flac_to_mp3_tags "$input" "$output"
 }
 
 convert_flac_to_mp3()
 {
        local workdir="$1"
-
        find "$workdir" -name '*.flac' \
                | sort \
                | parallel --will-cite \