#!/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}"
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 ]