summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconvert2mp327
1 files changed, 27 insertions, 0 deletions
diff --git a/convert2mp3 b/convert2mp3
new file mode 100755
index 0000000..5f5a2fa
--- /dev/null
+++ b/convert2mp3
@@ -0,0 +1,27 @@
+#!/bin/bash
+#----------------------------------------------------
+# Version: 0.1.0
+# Author: Florian "Bluewind" Pritz <f-p@gmx.at>
+#
+# Copyright (C) 2009 Florian Pritz
+#
+# Licensed under GNU General Public License v3
+# (see COPYING for full license text)
+#
+#----------------------------------------------------
+# Converts a file to an MP3
+#----------------------------------------------------
+
+for i in "$@"; do
+ pushd . &> /dev/null
+ cd "$(dirname "$i")"
+
+ file="$(basename "$i")"
+ file_mp3="$(echo ${file} | sed 's/\(.*\)\..*/\1/').mp3"
+ tmpfile="$(mktemp)"
+
+ mplayer -ao pcm:fast -novideo -vc null -vo null -ao pcm:file="$tmpfile" "$file"
+ lame -h "$tmpfile" "$file_mp3"
+
+ popd &> /dev/null
+done