-
-
Save sorokine/5281900 to your computer and use it in GitHub Desktop.
Revisions
-
jesseadams created this gist
Nov 21, 2010 .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,28 @@ #!/bin/bash convert_dir=$1 output_dir=$2 bitrate=$3 # Ensure require params are passed in if [ -z $convert_dir ] || [ -z $output_dir ]; then echo "Usage: flac2mp3 rip_dir output_dir [bitrate]" exit fi # Default to 320 kbps if bitrate not specified if [ -z $bitrate ]; then bitrate=320 fi # Get the list of files to convert files=( `find $convert_dir -iname '*.flac' | tr "\n" " "` ) # Convert each file, one at a time for file in ${files[*]} do flac -dc $file | lame -b $bitrate - $output_dir/`basename $file`.mp3 done echo "Conversions complete!"