summaryrefslogtreecommitdiffstats
path: root/play.sh
blob: d1b3dcfb19880083687325ff2e11b705e26e9871 (plain) (blame)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash

if ! which aplay >/dev/null 2>&1; then
	echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
	echo "!! This requires ALSA's aplay. !!"
	echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
	exit
fi

echo "==========================================="
echo "==           Fox News Sequencer          =="
echo "==           ------------------          =="
echo "--    Clips are property of Fox News     --"
echo "--        http://bit.ly/dTptl4           --"
echo "-- Music is property of Jason Donenfeld  --"
echo "--       http://jasondonenfeld.com       --"
echo "--                                       --"
echo "-- By using you waive the right to distr --"
echo "-- ibute anything made with this program --"
echo "-------------------------------------------"
echo
echo
echo "== keys =="
echo "- f - nutty"
echo "- j - with love"
echo "- n - graduate degree"
echo "- v - young folks"
echo "- h - sandwich"
echo "- ctrl+c - quit"
echo
echo -n "Keys: "

aplay backing.wav >/dev/null 2>&1 &

pid=0

while read -n 1 c; do

if [ $c == "f" ]; then
	f="nutty.wav"
elif [ $c == "j" ]; then
	f="withlove.wav"
elif [ $c == "n" ]; then
	f="graduatedegree.wav"
elif [ $c == "v" ]; then
	f="youngfolks.wav"
elif [ $c == "h" ]; then
	f="sandwich.wav"
else
	continue
fi

if [ $pid -gt 0 ]; then
	kill -9 $pid 2>/dev/null &
fi

aplay $f >/dev/null 2>&1 &
pid=$!

done