def play_successed(self, volume=2): self.success_player = pulseaudio.Play( [(self.blt_speaker.pa_index, volume)], "./win.wav", self.pa, repeat=False) while not self.success_player.is_playing(): sleep(0.1) while self.success_player.is_playing(): sleep(0.5) self.success_player.stop_playing() self.success_player = None
def play_ringtone(self, volume): self.ringtone = pulseaudio.Play( [(self.blt_speaker.pa_index, volume)], "../ringtone.mp3", self.pa)
def play_voices(self, volume=3): self.voices_player = pulseaudio.Play( [(0, volume)], "/home/pi/NAGRANIE_FINAL_BASIC.wav", self.pa, repeat=False)
def ambient_play(self): self.ambient_player = pulseaudio.Play([(self.blt_speaker.pa_index, 2)], "/home/pi/ambient1.wav", self.pa)