def endspeak(self, channel): if not channel.get_busy(): self.speaking = False #print ('...Finished') else: t = timer.ttimer(0.5, 1, self.endspeak, channel) t.Start()
def speak(self): if self.speaking: return id = random.randrange(1, 24, 1) file_path = os.path.join(Util.SOUND_DIR, 'zombie-%d.ogg' % id) sound = pygame.mixer.Sound(file_path) #print ('Playing Sound...') self.speaking = True channel = sound.play() t = timer.ttimer(0.5, 1, self.endspeak, channel) t.Start()
def speak(self): if self.speaking: return id = random.randrange(1,24,1) file_path = os.path.join('sounds', 'zombie-%d.ogg' % id) sound = pygame.mixer.Sound(file_path) #print ('Playing Sound...') self.speaking = True channel = sound.play() t = timer.ttimer(0.5, 1, self.endspeak, channel) t.Start()