summaryrefslogtreecommitdiffstats
path: root/god
diff options
context:
space:
mode:
authorroot <root@monitoring.shack>2012-09-13 23:39:58 +0000
committerroot <root@monitoring.shack>2012-09-13 23:39:58 +0000
commitdb849a18e1659ff28433384d2cdca2989a6d5df0 (patch)
treed600fb3f3e5f0a54b6254c85ee8a3b836ef3d90d /god
parentd5d39fc3d56b021b642ee6e1d5625524ebbc4d99 (diff)
parent88d4bdc29eb9ce5f62099f2be1488ae927aa09d5 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'god')
-rwxr-xr-xgod/overlord/index2
-rw-r--r--god/soundboard/README5
-rw-r--r--god/soundboard/config.json13
-rw-r--r--god/soundboard/sound.py46
4 files changed, 65 insertions, 1 deletions
diff --git a/god/overlord/index b/god/overlord/index
index ef0aebb3..d9cae0c2 100755
--- a/god/overlord/index
+++ b/god/overlord/index
@@ -17,7 +17,7 @@ streams/streams stop
amixer -q -c 0 -D hw:0 sset Front $max%
mplayer god/overlord/announce.mp3 >/dev/null
-espeak -v de -s 120 -a 900 "$*"
+../../util/bin/naturalvoices2.sh "$*"
# fade-in streams
streams/streams start
diff --git a/god/soundboard/README b/god/soundboard/README
new file mode 100644
index 00000000..8fbb8947
--- /dev/null
+++ b/god/soundboard/README
@@ -0,0 +1,5 @@
+# Soundboard
+The basic idea is to use a joystick or gamepad to trigger actions
+
+# config.json
+currently there is only one joystick supported, as well as one pad and buttons
diff --git a/god/soundboard/config.json b/god/soundboard/config.json
new file mode 100644
index 00000000..dbdeb5cb
--- /dev/null
+++ b/god/soundboard/config.json
@@ -0,0 +1,13 @@
+{
+ "direction" : {
+ "up" : "echo pushed up",
+ "down" : "echo pushed down",
+ "left" : "echo pushed left",
+ "right" : "echo pushed right"
+ },
+ "button" : {
+ "1" : "echo 'fuck yeah 1'",
+ "2" : "echo 'fuck jeah 2'",
+ "8" : "echo 'fuck jeah 8'"
+ }
+}
diff --git a/god/soundboard/sound.py b/god/soundboard/sound.py
new file mode 100644
index 00000000..f6564db0
--- /dev/null
+++ b/god/soundboard/sound.py
@@ -0,0 +1,46 @@
+import pygame
+import os
+from pygame import locals
+import json
+CFG_FILE = "config.json"
+cfg = json.load(open(CFG_FILE))
+
+pygame.init()
+pygame.joystick.init()
+try:
+ j = pygame.joystick.Joystick(0)
+ j.init()
+ print 'Enabled joystick: ' + j.get_name()
+except pygame.error:
+ print 'no joystick found.'
+
+
+while 1:
+ for e in pygame.event.get():
+ #print 'event : ' + str(e.type)
+ #print 'data : ' + str(e.dict)
+ if e.type == pygame.locals.JOYAXISMOTION:
+ x, y = j.get_axis(0), j.get_axis(1)
+ if (x > 0):
+ direction = "right"
+ elif(x < 0):
+ direction = "left"
+ if (y > 0):
+ direction = "up"
+ elif(y < 0):
+ direction = "down"
+ if (y == x == 0):
+ pass
+ else:
+ try:
+ os.system(cfg["direction"][direction])
+ except Exception as balls:
+ print "direction not defined?", balls
+
+ elif e.type == pygame.locals.JOYBUTTONDOWN:
+ try:
+ os.system(cfg["button"][str(e.button)])
+ except Exception as balls:
+ print "button not defined: ", balls
+ #elif e.type == pygame.locals.JOYBUTTONUP:
+ # print 'button up', e.joy, e.button