summaryrefslogtreecommitdiff
path: root/wiiplay
blob: 237fab8f9eefc4adf4f044017bf838a7a80b8a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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 <btaddr> <file> [volume]" >&2
	echo "volume: 0 .. 255, default 64" >&2
	exit 1
fi

sox --show-progress --norm ${2} -b 8 /tmp/wiiplay.raw \
	channels 1 rate 2000 vol 0.5

./wiispkr ${1} ${3} < /tmp/wiiplay.raw 2> /dev/null &
PID=$!

sudo renice -10 $PID

trap 'kill $PID' INT

wait

rm /tmp/wiiplay.raw