def play_sound(self, _, event): """ Play a test sound """ # Check if first click or 3 seconds have passed ready = (self.time_click is None) or (time.time() - self.time_click > 3) # If ready and enter key is pressed or mouse button is clicked if ready and \ (not hasattr(event, 'keyval') or event.keyval == 65293): self.time_click = time.time() play_sound('/usr/share/kano-media/sounds/kano_test_sound.wav', background=True) time.sleep(1) self.template.yes_button.set_sensitive(True) self.template.no_button.set_sensitive(True) self.template.yes_button.grab_focus()
def _a_clicked(self): play_sound('/usr/share/kano-media/sounds/kano_error.wav', True)
def _s_clicked(self): play_sound('/usr/share/kano-media/sounds/kano_achievement_unlock.wav', True)
def play_sounds(filename): print os.path.realpath(os.path.join(_get_static_dir(), filename)) sound_file = os.path.realpath(os.path.join(_get_static_dir(), filename)) play_sound(sound_file) return ''
def _d_clicked(self, scene): play_sound('/usr/share/kano-media/sounds/kano_boot_up.wav', True) self._show_console(scene)