]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
Bitrate,Mode configure in .flactomp3v2.conf
authorBastian Dehn <hhaalo@arcor.de>
Mon, 11 Jul 2016 14:33:16 +0000 (16:33 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 11 Jul 2016 14:33:16 +0000 (16:33 +0200)
flactomp3v2.sh

index b0512585d9ab594f8a00f49602d26aca425ee6cf..49c6884d5facddee608c1e47cddeaba1821d82d2 100755 (executable)
@@ -1,5 +1,14 @@
 #!/bin/bash
 
+# Default options
+BITRATE=192
+MODE="j"
+
+if [ -f $HOME/.flactomp3v2.conf ]
+then
+       source $HOME/.flactomp3v2.conf
+fi
+
 a=$1
 # give output correct extension
 OUTF="${a[@]/%flac/mp3}"
@@ -18,7 +27,7 @@ RAG=$(metaflac "$a" --show-tag=REPLAYGAIN_ALBUM_GAIN | sed s/.*=//g)
 RAP=$(metaflac "$a" --show-tag=REPLAYGAIN_ALBUM_PEAK | sed s/.*=//g)
 
 # stream flac into the lame encoder
-flac -s -c -d "$a" | lame --silent -b 192 -m j --noreplaygain - "$OUTF"
+flac -s -c -d "$a" | lame --silent -b $BITRATE -m $MODE --noreplaygain - "$OUTF"
 
 # ID3v2.3 tagging
 if [ -f ${a%/*}/cover.jpg ]