summaryrefslogtreecommitdiff
path: root/wiiplay
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-12-24 03:04:45 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-12-24 03:04:45 +0100
commitef06f59cb716f494dfd7348e01ffa8fd698967a0 (patch)
treeb81f647a1d57c4cf3bf7b7922c96dc225e3f4dff /wiiplay
parent2c71143fd27ab876d7165df3f643bcad2664ccb0 (diff)
Add wiiplay (wiiskpr wrapper with automatic conversion)
Diffstat (limited to 'wiiplay')
-rwxr-xr-xwiiplay36
1 files changed, 36 insertions, 0 deletions
diff --git a/wiiplay b/wiiplay
new file mode 100755
index 0000000..b3ee3aa
--- /dev/null
+++ b/wiiplay
@@ -0,0 +1,36 @@
+#!/usr/bin/env zsh
+## Copyright © 2011 by Daniel Friesel <derf@finalrewind.org>
+## License: WTFPL:
+## 0. You just DO WHAT THE FUCK YOU WANT TO
+
+setopt err_exit
+
+if [[ -z $1 || -z $2 ]]; then
+ echo "Usage: $0 <file>" >&2
+ exit 1
+fi
+
+if [[ ${2:e} == ogg ]]; then
+
+ oggdec -o /tmp/wiiplay.wav ${2}
+
+elif [[ ${2:e} == mp3 ]]; then
+
+ mpg321 -w /tmp/wiiplay.wav ${2}
+
+elif [[ ${2:e} == wav ]]; then
+
+ cp ${2} /tmp/wiiplay.wav
+
+else
+
+ echo "${2:e}: unsupported format" >&2
+ exit 1
+
+fi
+
+sox --norm /tmp/wiiplay.wav -b 8 /tmp/wiiplay.raw channels 1 rate 1500
+
+rm /tmp/wiiplay.wav
+
+./wiispkr ${1} < /tmp/wiiplay.raw