From: Bastian Dehn Date: Thu, 13 Jul 2017 16:25:25 +0000 (+0200) Subject: change: structur flactomp3 X-Git-Tag: v1.0.0^2~104 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=2771fc74f2263aed27d2d341078043ba5824a435;p=albentohandy.git change: structur flactomp3 --- diff --git a/flactomp3v2 b/flactomp3v2 index bcc799d..fa3e1bb 100755 --- a/flactomp3v2 +++ b/flactomp3v2 @@ -30,6 +30,8 @@ ReadFlacToMp3Tags() { local readonly RAG=$(metaflac "$INPUTFILE" --show-tag=REPLAYGAIN_ALBUM_GAIN | tr '=' ':') local readonly RAP=$(metaflac "$INPUTFILE" --show-tag=REPLAYGAIN_ALBUM_PEAK | tr '=' ':') + # -------------------------------------------------- + # ID3v2.3 tagging with cover and without cover local eyed3Command="eyeD3 --v2 --to-v2.3 \ --artist=\"$ARTIST\" --title=\"$TITLE\" --album=\"$ALBUM\" --genre=\"${GENRE:-12}\" \ @@ -39,27 +41,35 @@ ReadFlacToMp3Tags() { --user-text-frame=\"$RTP\" \ --user-text-frame=\"$RAG\" \ --user-text-frame=\"$RAP\"" + + # add cover picture to command if [ -f $INPUTFILEDIR/cover.jpg ]; then local eyed3Command+=" --add-image=\"$INPUTFILEDIR/cover.jpg\":FRONT_COVER" fi + + # finally command end local eyed3Command+=" \"$OUTPUTFILE\" > /dev/null 2>&1" + + # execute eyeD3 command eval $eyed3Command } EncodingFlacToMp3() { local readonly INPUTFILE="$1" local readonly OUTPUTFILE="$2" + # stream flac into the lame encoder nice --adjustment=2 flac --silent --stdout --decode "$INPUTFILE" | nice --adjustment=3 lame --silent -b $BITRATE -m $MODE --noreplaygain - "$OUTPUTFILE" } main() { - local readonly INPUTFILE=$1 - local readonly OUTPUTFILE="${INPUTFILE[@]/%flac/mp3}" # give output correct extension + local readonly INPUTFILE="$1" + local readonly OUTPUTFILE="${INPUTFILE[@]/%flac/mp3}" + EncodingFlacToMp3 "$INPUTFILE" "$OUTPUTFILE" ReadFlacToMp3Tags "$INPUTFILE" "$OUTPUTFILE" } -main $1 +main "$1" exit 0