Skip to content

Instantly share code, notes, and snippets.

@earlcochran
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earlcochran/55d22ba2905c41a6c2dc to your computer and use it in GitHub Desktop.
Save earlcochran/55d22ba2905c41a6c2dc to your computer and use it in GitHub Desktop.
Convert FLAC files to LAME V0 mp3's
if [ ! -d "mp3" ]; then
mkdir mp3
fi
for f in *.flac; do
for tag in TITLE ARTIST ALBUM DATE COMMENT TRACKNUMBER TRACKTOTAL GENRE; do
eval "$tag=\"`metaflac --show-tag=$tag "$f" | sed 's/.*=//'`\""
done
flac -cd "$f" | lame -V0 -q0 --noreplaygain --tt "$TITLE" --ta "$ARTIST" \
--tl "$ALBUM" --ty "$DATE" --tc "$COMMENT" --tn "$TRACKNUMBER/$TRACKTOTAL" --tg "$GENRE" - mp3/"${f%.*}".mp3;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment