Created
April 17, 2015 20:26
-
-
Save sashka/ba82993fc1b7c06a0dd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for a in *.flac; do | |
| # give output correct extension | |
| OUTF="${a[@]/%flac/mp3}" | |
| # get the tags | |
| 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) | |
| # stream flac into the lame encoder | |
| flac -c -d "$a" | lame -V0 --add-id3v2 --pad-id3v2 --ignore-tag-errors \ | |
| --ta "$ARTIST" --tt "$TITLE" --tl "$ALBUM" --tg "${GENRE:-12}" \ | |
| --tn "${TRACKNUMBER:-0}" --ty "$DATE" - "$OUTF" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment