(self)
| 13 | super(MyApp, self).__init__(*args) |
| 14 | |
| 15 | def main(self): |
| 16 | # We need to get dynamically the available voices |
| 17 | self.voices_dict = {} |
| 18 | # Default English_(Great_Britain) voice |
| 19 | self.selected_voice_id = 78 |
| 20 | self.voices_dropdown = gui.DropDown.new_from_list(["Loading voices list..."], |
| 21 | width=200, height=20, margin='10px') |
| 22 | self.container = gui.VBox(width=400) |
| 23 | self.lbl = gui.Label("Text to say:") |
| 24 | self.text_input = gui.TextInput(width=300) |
| 25 | self.lbl_rate = gui.Label("Rate (speed) to say:") |
| 26 | self.rate_slider = gui.Slider(1.0, min=0.1, max=5.0, step=0.1) |
| 27 | self.lbl_pitch = gui.Label("Pitch of voice:") |
| 28 | self.pitch_slider = gui.Slider(1.0, min=0.1, max=2.0, step=0.1) |
| 29 | self.bt_say = gui.Button("Say") |
| 30 | self.bt_say.onclick.do(self.on_say) |
| 31 | |
| 32 | self.container.append(self.lbl) |
| 33 | self.container.append(self.text_input) |
| 34 | self.container.append(self.lbl_rate) |
| 35 | self.container.append(self.rate_slider) |
| 36 | self.container.append(self.lbl_pitch) |
| 37 | self.container.append(self.pitch_slider) |
| 38 | self.container.append(self.bt_say) |
| 39 | self.container.append(self.voices_dropdown, key=99999) |
| 40 | |
| 41 | # returning the root widget |
| 42 | return self.container |
| 43 | |
| 44 | def idle(self): |
| 45 | """ |
nothing calls this directly
no test coverage detected