Last active
December 18, 2015 14:18
Revisions
-
pearkes revised this gist
Jun 17, 2013 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,16 +9,14 @@ # # flactomp3 DIRECTORY # # # Fail fast set -e # Check to see if ffmpeg is kickin it here if [ ! -f `type -P` ]; then echo "You need to install ffmpeg (brew/apt-get install ffmpeg)" exit fi @@ -30,7 +28,7 @@ fi # Are there flac files in there? if [ `ls -1 $1/*.flac 2>/dev/null | wc -l` = 0 ]; then echo "There aren't any flac files in `pwd`/$1" exit fi -
pearkes revised this gist
Jun 17, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,9 @@ # # flactomp3 DIRECTORY # # Install: # # curl -L http://git.io/IrxqdA >> /usr/local/bin/flactomp3; chmod +x /usr/local/bin/flactomp3 # Fail fast set -e -
pearkes created this gist
Jun 17, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ #!/bin/sh # Converts a directory of .flac files to the proprietary and lossy # .mp3 format, retaining meta data. # # Note: Requires ffmpeg (brew/apt-get install ffmpeg) # # Use: # # flactomp3 DIRECTORY # # # Fail fast set -e # Check to see if ffmpeg is kickin it here if [ ! -f `type -P` ]; then echo "You need to install ffmpeg. (brew/apt-get install ffmpeg)" exit fi # Is the first argument there, is it a dir? if [ ! $1 ] || [ ! -d $1 ]; then echo "Requires directory as first argument" exit fi # Are there flac files in there? if [ `ls -1 $1/*.flac 2>/dev/null | wc -l` = 0 ]; then echo "There aren't any flac files in `pwd $1`" exit fi echo "Starting conversion..." for file in $1/*.flac; do ffmpeg -i "$file" -ab 320k -map_metadata 0 "${file%.*}.mp3"; done echo "Finished"