Пример #1
0
    def play_audio(self, Flag):
        if Flag == 1:
            self.player = PlayAudio(kwargs={'filename': self.selected_filename,'root': self})
            self.player.start()

        elif Flag == 0:
            print Flag
            self.player.stop()
        else:
            print Flag
            self.player.playback(Flag)
Пример #2
0
class WView(BoxLayout):

    def __init__(self, dir):
        self.selected_filename = dir
        super(WView, self).__init__()
        self.read_data_descript()

    def play_audio(self, Flag):
        if Flag == 1:
            self.player = PlayAudio(kwargs={'filename': self.selected_filename,'root': self})
            self.player.start()

        elif Flag == 0:
            print Flag
            self.player.stop()
        else:
            print Flag
            self.player.playback(Flag)

    def gsra_start(self):
        gsra = SpeechInput(args=self)
        gsra.start()

    def read_data_descript(self):
        filename = self.selected_filename
        descript = JsonStore('data_descript.json')
        desc = descript.get(filename)['desc']
        self.ids['cw_desc'].text = desc

    def grade(self):
        grading = Grading()
        marks = grading.get_grade(self.selected_filename, self)
        self.ids['marks'].text = 'Congratuactions! Your mark is %d '%marks
        print marks