Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for source in ./*.flac; do
- # give output correct extension
- DESTINATION="${source[@]/%flac/mp3}"
- # get the tags
- ARTIST=$(metaflac "$source" --show-tag=ARTIST | sed s/.*=//g)
- TITLE=$(metaflac "$source" --show-tag=TITLE | sed s/.*=//g)
- ALBUM=$(metaflac "$source" --show-tag=ALBUM | sed s/.*=//g)
- GENRE=$(metaflac "$source" --show-tag=GENRE | sed s/.*=//g)
- TRACKNUMBER=$(metaflac "$source" --show-tag=TRACKNUMBER | sed s/.*=//g)
- DATE=$(metaflac "$source" --show-tag=DATE | sed s/.*=//g)
- # stream flac into the lame encoder
- flac -c -d "$source" | lame -V0 --add-id3v2 --pad-id3v2 --ignore-tag-errors \
- --ta "$ARTIST" --tt "$TITLE" --tl "$ALBUM" --tg "${GENRE:-12}" \
- --tn "${TRACKNUMBER:-0}" --ty "$DATE" - "$DESTINATION"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement