summaryrefslogtreecommitdiffstats
path: root/convert2ogg
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-10-13 17:03:15 +0200
committerFlorian Pritz <bluewind@xssn.at>2009-10-13 17:03:15 +0200
commitd0e897329bc9c2ca5ef87292fa42877e55537280 (patch)
tree0622d81b724da522dbabda7872c47d3b28a4f248 /convert2ogg
parentb1e286ec9482e1eb0b97b6e125af39b76a20337e (diff)
downloadbin-d0e897329bc9c2ca5ef87292fa42877e55537280.tar.gz
bin-d0e897329bc9c2ca5ef87292fa42877e55537280.tar.xz
add convert2ogg
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'convert2ogg')
-rwxr-xr-xconvert2ogg27
1 files changed, 27 insertions, 0 deletions
diff --git a/convert2ogg b/convert2ogg
new file mode 100755
index 0000000..87638be
--- /dev/null
+++ b/convert2ogg
@@ -0,0 +1,27 @@
+#!/bin/bash
+#----------------------------------------------------
+# Version: 0.1.0
+# Author: Florian "Bluewind" Pritz <f-p@gmx.at>
+#
+# Licensed under WTFPL v2
+# (see COPYING for full license text)
+#
+#----------------------------------------------------
+# Converts a file to an OGG
+#----------------------------------------------------
+
+for i in "$@"; do
+ pushd . &> /dev/null
+ cd "$(dirname "$i")"
+
+ file="$(basename "$i")"
+ file_ogg="$(echo ${file} | sed 's/\(.*\)\..*/\1/').ogg"
+ tmpfile="$(echo ${file} | sed 's/\(.*\)\..*/\1/').wav"
+
+ mplayer -ao pcm:fast -novideo -vc null -vo null -ao pcm:file="$tmpfile" "$file"
+ oggenc -q 5 "$tmpfile"
+
+ rm "$tmpfile"
+
+ popd &> /dev/null
+done