Пример #1
0
    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()
Пример #2
0
 def _a_clicked(self):
     play_sound('/usr/share/kano-media/sounds/kano_error.wav', True)
Пример #3
0
 def _s_clicked(self):
     play_sound('/usr/share/kano-media/sounds/kano_achievement_unlock.wav', True)
Пример #4
0
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 ''
Пример #5
0
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 ''
Пример #6
0
 def _d_clicked(self, scene):
     play_sound('/usr/share/kano-media/sounds/kano_boot_up.wav', True)
     self._show_console(scene)
Пример #7
0
 def _d_clicked(self, scene):
     play_sound('/usr/share/kano-media/sounds/kano_boot_up.wav', True)
     self._show_console(scene)