diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2011-12-24 18:28:00 +0100 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2011-12-24 18:28:00 +0100 | 
| commit | ea645480d7ebbe031c9bb5dfd7b6fdccea4a73d0 (patch) | |
| tree | 8f91807244bb7f3682f07f7e491e3dd3eff9a91b | |
| parent | 63f984d616904262da42f28c845e54c0e02d5f6f (diff) | |
wiiplay: sox can convert by itself (thx mxey)
| -rwxr-xr-x | wiiplay | 30 | 
1 files changed, 9 insertions, 21 deletions
@@ -6,33 +6,21 @@  setopt err_exit  if [[ -z $1 || -z $2 ]]; then -	echo "Usage: $0 <btaddr> <file>" >&2 +	echo "Usage: $0 <btaddr> <file> [volume]" >&2 +	echo "volume: 0 .. 255, default 64" >&2  	exit 1  fi -if [[ ${2:e} == ogg ]]; then +sox --show-progress --norm ${2} -b 8 /tmp/wiiplay.raw \ +	channels 1 rate 2000 vol 0.5 -	oggdec -o /tmp/wiiplay.wav ${2} +./wiispkr ${1} ${3} < /tmp/wiiplay.raw 2> /dev/null & +PID=$! -elif [[ ${2:e} == mp3 ]]; then +sudo renice -10 $PID -	mpg321 -w /tmp/wiiplay.wav ${2} +trap 'kill $PID' INT -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 2000 - -rm /tmp/wiiplay.wav - -./wiispkr ${1} < /tmp/wiiplay.raw 2> /dev/null +wait  rm /tmp/wiiplay.raw  | 
