Advertisement
Guest User

smok

a guest
Apr 12th, 2009
749
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.82 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Simple FLAC to MP3 converter
  4. # Requires 'flac' and 'lame' packages
  5. # Author: smok (http://smok.zoxt.net/)
  6. # Save it as ~/flac2mp3.sh, chmod +x it, and call from direcory with *.flac files.
  7.  
  8. for ffile in *.flac;
  9. do
  10.         ARTIST=`metaflac "$ffile" --show-tag=ARTIST | sed s/.*=//g`
  11.         TITLE=`metaflac "$ffile" --show-tag=TITLE | sed s/.*=//g`
  12.         ALBUM=`metaflac "$ffile" --show-tag=ALBUM | sed s/.*=//g`
  13.         GENRE=`metaflac "$ffile" --show-tag=GENRE | sed s/.*=//g`
  14.         TRACKNUMBER=`metaflac "$ffile" --show-tag=TRACKNUMBER | sed s/.*=//g`
  15.         DATE=`metaflac "$ffile" --show-tag=DATE | sed s/.*=//g`
  16.         flac -dc "$ffile" | lame --quiet -b 320 --tt "$TITLE" --ta "$ARTIST" --tl "$ALBUM" --tn "$TRACKNUMBER" --tg "$GENRE" --ty "$DATE" - "`echo "$ffile" | sed s/\.flac$/\.mp3/g`"
  17. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement