Permalink
Browse files

Stopping concurrent plays to see if that fixes prob.

  • Loading branch information...
1 parent b70dcca commit adc34ecd4ddea707b7c371b3d44cf53777e37555 @mrichardson23 committed Oct 7, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 sampler.py
View
@@ -8,21 +8,29 @@
GPIO.setup(8, GPIO.IN)
GPIO.setup(9, GPIO.IN)
-pygame.mixer.init(48000, -8,1,15000)
+pygame.mixer.init(48000, -8,2,15000)
pygame.init()
soundA = pygame.mixer.Sound("/usr/share/sounds/KDE-Im-Cant-Connect.ogg")
soundB = pygame.mixer.Sound("/usr/share/sounds/KDE-Im-Message-In.ogg")
soundC = pygame.mixer.Sound("/usr/share/sounds/KDE-Im-Message-Out.ogg")
+print "Sampler Ready."
+
while True:
try:
if (GPIO.input(7) == True):
soundA.play()
+ sleep(soundA.get_length())
+ soundA.stop()
if (GPIO.input(8) == True):
soundB.play()
+ sleep(soundB.get_length())
+ soundB.stop()
if (GPIO.input(9) == True):
soundC.play()
+ sleep(soundC.get_length())
+ soundC.stop()
sleep(.01)
except KeyboardInterrupt:
sys.exit()

0 comments on commit adc34ec

Please sign in to comment.