MCPcopy Index your code
hub / github.com/rawpython/remi / _voices_callback

Method _voices_callback

examples/text_to_speech_app.py:51–64  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

49 self._get_available_voices()
50
51 def _voices_callback(self, **kwargs):
52 # print("_voices_callback args: {}".format(kwargs))
53 self.voices_dict = kwargs
54 voice_options = kwargs.keys()
55 # Show the voice options sorted alphabetically
56 voice_options = sorted(voice_options)
57 # Sometimes we get an empty list, then do nothing, we will try later again
58 if voice_options:
59 self.container.remove_child(self.voices_dropdown)
60 self.voices_dropdown = gui.DropDown.new_from_list(voice_options,
61 width=200, height=20, margin='10px')
62 self.voices_dropdown.onchange.do(self._drop_down_changed)
63 self.container.append(self.voices_dropdown)
64 self.voices_dropdown.select_by_value("English_(Great_Britain)")
65
66 def _drop_down_changed(self, widget, value):
67 self.selected_voice_id = int(self.voices_dict[value])

Callers

nothing calls this directly

Calls 5

remove_childMethod · 0.45
new_from_listMethod · 0.45
doMethod · 0.45
appendMethod · 0.45
select_by_valueMethod · 0.45

Tested by

no test coverage detected