lazy flac to mp3 converter
authorAndrew Lorimer <andrew@lorimer.id.au>
Wed, 31 Oct 2018 03:30:52 +0000 (14:30 +1100)
committerAndrew Lorimer <andrew@lorimer.id.au>
Wed, 31 Oct 2018 03:30:52 +0000 (14:30 +1100)
flactomp3.sh [new file with mode: 0755]
diff --git a/flactomp3.sh b/flactomp3.sh
new file mode 100755 (executable)
index 0000000..0837eb0
--- /dev/null
@@ -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