From ef06f59cb716f494dfd7348e01ffa8fd698967a0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 24 Dec 2011 03:04:45 +0100 Subject: Add wiiplay (wiiskpr wrapper with automatic conversion) --- wiiplay | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 wiiplay (limited to 'wiiplay') 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 +## License: WTFPL: +## 0. You just DO WHAT THE FUCK YOU WANT TO + +setopt err_exit + +if [[ -z $1 || -z $2 ]]; then + echo "Usage: $0 " >&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 -- cgit v1.2.3