summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-11-08 15:42:54 +0100
committerlassulus <lass@aidsballs.de>2015-11-08 15:42:54 +0100
commit094789f9250531087b630e92324d3b81b28a881d (patch)
tree18a8a750c71eaf2b5d0c383e3ee8e1034c0b2879
parent533d789a1a549bb8fb1aac940a0d8d6ed36e8c38 (diff)
add ogg2mp3 converter
-rw-r--r--Makefile3
-rwxr-xr-xbin/ogg2mp315
2 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ebecb7a..ad04750 100644
--- a/Makefile
+++ b/Makefile
@@ -29,3 +29,6 @@ play: ## play the playlist without downloading
copy: ## make copy dest="/mnt/tmp/music"
copy: ## to copy music to dest
rsync -vrltD ./music/ ${dest}
+
+convert2mp3: ## converts stuff from ./music to ./mp3
+ ls music/* | target=./mp3 xargs -n1 bin/ogg2mp3
diff --git a/bin/ogg2mp3 b/bin/ogg2mp3
new file mode 100755
index 0000000..1fbf414
--- /dev/null
+++ b/bin/ogg2mp3
@@ -0,0 +1,15 @@
+#! /bin/sh
+set -euf
+target_folder=${target-./}
+
+source=$1
+target_mp3=$(basename $1 | sed 's/ogg$/mp3/')
+
+mkdir -p $target_folder
+
+if test -e $target_folder/$target_mp3; then
+ echo "already done: $target_mp3 in $target_folder" >&2
+ exit
+fi
+
+ffmpeg -i $source $target_folder/$target_mp3