From: Andrew Lorimer Date: Wed, 31 Oct 2018 03:30:52 +0000 (+1100) Subject: lazy flac to mp3 converter X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/868b8bf61bca70a24874fb4a39dec09b6f3461d7?ds=inline;hp=-c lazy flac to mp3 converter --- 868b8bf61bca70a24874fb4a39dec09b6f3461d7 diff --git a/flactomp3.sh b/flactomp3.sh new file mode 100755 index 0000000..0837eb0 --- /dev/null +++ b/flactomp3.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +# lazy wrapper for ffmpeg to convert flac to mp3 +# usage: flactomp3.sh [dir] +# all *.flac in [dir] or current directory are converted to mp3 if not already done + +if [ -z $1 ]; then + dir=$(pwd) +else + dir=$1 +fi + +for i in $dir/*.flac; do ffmpeg -n -i "$i" -ab 320k -map_metadata 0 -id3v2_version 3 "${i%.*}.mp3"; done \ No newline at end of file