Skip to content
Browse files

Merge branch 'master' of git@github.com:v21/Sweareoke

  • Loading branch information...
2 parents 9e1a546 + c5113f7 commit 88b2ebcb17d01dd1e1b39e2f1983f6c79df07cca George Buckenham committed
Showing with 12 additions and 1 deletion.
  1. +12 −1 game.py
View
13 game.py
@@ -56,6 +56,7 @@ def init(self):
self.display.init()
self.display.load_title()
self.song = pygame.mixer.music.load(self.filename)
+ pygame.mixer.music.set_volume(0.4)
if (pygame.joystick.get_count() > 0):
self.guitar = pygame.joystick.Joystick(0)
self.guitar.init()
@@ -84,6 +85,7 @@ def init(self):
word.sound = pygame.mixer.Sound(word.audiofile)
+ word.sound.set_volume(0.2)
self.get_swears()
@@ -95,11 +97,13 @@ def get_swears(self):
word.resp = self.forvo.queryWord(word.text)
word.audiofile = self.forvo.fetchRecording(word.resp,0, word.resp.word)
word.audiofile = self.forvo.postprocessAudio(word.audiofile)
+ word.sound = pygame.mixer.Sound(word.audiofile)
+ word.sound.set_volume(1)
+ self.swears.append(word)
except:
print "no swear " + swear
continue
- self.swears.append(word)
def synthesize_word(self, word):
word_text_file = "tmp_word.txt"
@@ -145,6 +149,13 @@ def correct(self, word):
self.display.correct(word.column)
def incorrect(self, column):
+ swear = self.swears[randint(0,len(self.swears)-1)]
+ try:
+ print " play swear"
+ channel = swear.sound.play()
+ except:
+ print "cant play swear"
+ pass
self.display.incorrect(column)
def check_words(self, time):

0 comments on commit 88b2ebc

Please sign in to comment.
Something went wrong with that request. Please try again.