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()
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)
def init_mixer(self): ap = get_audio_player() self.mixer = Mixer(ap) ap.add_mixer(self.mixer)
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)