示例#1
0
    def destroy(self):
        if self.animation_task:
            self.animation_task.stop()

        if self.client:
            self.client.disconnect()

        Wifi.connect(self.old_network)
        
        self.mixer.clear()
        get_audio_player().remove_mixer(self.mixer)
        
        super().destroy()
示例#2
0
def load_sounds():
	print("[Robot] [INFO] [load_sounds] Loading sounds to RAM")
	ap = get_audio_player()

	for sound in Res.SOUNDS:
		path = os.path.join(Res.SOUND_PATH, sound)
		ap.load_sound(path)
示例#3
0
 def init_mixer(self):
     ap = get_audio_player()
     self.mixer = Mixer(ap)
     ap.add_mixer(self.mixer)
示例#4
0
 def play_connection_error_sound(self):
     ap = get_audio_player()
     sound = ap.get_sound(os.path.join(Res.SOUND_PATH, "connection_error.wav"))
     sound.play()
     self.mixer.add_sound(sound)