Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (19 sloc) 718 Bytes
#!/bin/bash
#./flac2mp3 /srv/media/music /srv/media/music-mp3
#Found on internet
if [ ! -d $3 ]
then
mkdir $3
fi
find *.flac -print0 | while read -d $'\0' a
do
OUTF=`echo "$a" | sed s/\.flac$/.mp3/g`
ARTIST=`metaflac "$a" --show-tag=ARTIST | sed s/.*=//g`
TITLE=`metaflac "$a" --show-tag=TITLE | sed s/.*=//g`
ALBUM=`metaflac "$a" --show-tag=ALBUM | sed s/.*=//g`
GENRE=`metaflac "$a" --show-tag=GENRE | sed s/.*=//g`
TRACKNUMBER=`metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g`
DATE=`metaflac "$a" --show-tag=DATE | sed s/.*=//g`
flac -c -d "$a" | lame -m j -q 0 --vbr-new -V 0 -s 44.1 - "$OUTF"
id3 -t "$TITLE" -T "${TRACKNUMBER:-0}" -a "$ARTIST" -A "$ALBUM" -y "$DATE" -g "${GENRE:-12}" "$OUTF"
done
Something went wrong with that request. Please try again.