Loading

BASH - Flac > MP3

  1. ## flac2mp3.sh
  2. # Encode
  3. # v0.1 17.08.08 - First created
  4. # Darren O'Connor
  5.  
  6. # This script, when run in a folder full of FLAC files, will create high quality VBR mp3's for use in mp3 players.
  7. # This version uses lame 3.98. If you use version 3.97 and below you'll need to change a few options
  8.  
  9. #!/bin/bash
  10. mkdir wav/
  11. flac -d *.flac
  12. mv *.wav wav/
  13. cd wav/
  14.  
  15. for f in *.wav; do mv "$f" "${f%.wav}";done
  16.  
  17. mkdir ../mp3/
  18. find -maxdepth 1 -type f -name '*' -exec lame -V0 -q0 '{}' -o '../mp3/{}' \;
  19. cd ../mp3/
  20. for FILE in *; do mv "$FILE" "$FILE.mp3"; done
  21. cd ../
  22. rm -r wav/
  23.  
  24. ##########
  25. #Version2
  26. ##########
  27.  
  28. #!/bin/bash
  29.  
  30. for FILE in *.flac;
  31. do
  32.     ffmpeg -i "$FILE" -ab 320k -map_metadata 0 "${FILE%.*}.mp3";
  33. done

Comments