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 \