Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ListenSpell.py
diff options
context:
space:
mode:
authorAssim <assim@localhost.localdomain>2009-03-30 05:47:13 (GMT)
committer Assim <assim@localhost.localdomain>2009-03-30 05:47:13 (GMT)
commitf10e907e90b7555110d96c74c2d3341d60fd69a0 (patch)
treebbbc48836f3da39453bb8148d4896bd385ac4314 /ListenSpell.py
parentbae7e68f664f99d520fda046eea6ca489ea2863f (diff)
speech dispatcher dependency removed
Diffstat (limited to 'ListenSpell.py')
-rwxr-xr-xListenSpell.py67
1 files changed, 33 insertions, 34 deletions
diff --git a/ListenSpell.py b/ListenSpell.py
index cd94bf0..20dffe3 100755
--- a/ListenSpell.py
+++ b/ListenSpell.py
@@ -29,7 +29,7 @@ class ListenSpell(activity.Activity):
DBname = "dict.db"
self.las.load_db(DBname)
- self.las.load_speechd_config()
+ self.las.load_espeak_config()
self.use_phoneme = False
@@ -131,15 +131,15 @@ class ListenSpell(activity.Activity):
self.change_skill_level_button = gtk.Button("Change Skill Level")
self.change_skill_level_button.connect("clicked", self.change_skill_level_button_clicked, None)
- self.change_speechd_config_button = gtk.Button("Speech Configuration")
- self.change_speechd_config_button.connect("clicked", self.speech_configuration_button_clicked, None)
+ self.change_espeak_config_button = gtk.Button("Speech Configuration")
+ self.change_espeak_config_button.connect("clicked", self.speech_configuration_button_clicked, None)
self.v_buttonbox.add(self.repeat_word_button)
self.v_buttonbox.add(self.get_def_button)
self.v_buttonbox.add(self.get_usage_button)
self.v_buttonbox.add(self.get_word_length_button)
self.v_buttonbox.add(self.change_skill_level_button)
- self.v_buttonbox.add(self.change_speechd_config_button)
+ self.v_buttonbox.add(self.change_espeak_config_button)
self.v_buttonbox.show_all()
@@ -200,11 +200,11 @@ class ListenSpell(activity.Activity):
def _update_configuration(self, widget, attribute ):
if attribute == "voice":
- self.las.speechd_config(attribute, widget.get_active_text())
+ self.las.espeak_config(attribute, widget.get_active_text())
elif(attribute == "skill_level"):
self.las.set_skill_level(int(widget.skill_level))
else:
- self.las.speechd_config(attribute, widget.get_value())
+ self.las.espeak_config(attribute, widget.get_value())
def _speech_test(self, widget, speech_text):
@@ -225,13 +225,17 @@ class ListenSpell(activity.Activity):
self.config_dialog.vbox.pack_start(speech_frame, False, False, 0)
- speech_config = self.las.get_speechd_config().copy()
+ speech_config = self.las.get_espeak_config().copy()
#print "getting config"
- volume_adj = gtk.Adjustment(float(speech_config['volume']), -100, 101, 1, 1, 1)
- rate_adj = gtk.Adjustment(float(speech_config['rate']), -100, 101, 1, 1, 1)
- pitch_adj = gtk.Adjustment(float(speech_config['pitch']), -100, 101, 1, 1, 1)
-
+ #volume_adj = gtk.Adjustment(float(speech_config['volume']), -100, 101, 1, 1, 1)
+ #rate_adj = gtk.Adjustment(float(speech_config['rate']), -100, 101, 1, 1, 1)
+ #pitch_adj = gtk.Adjustment(float(speech_config['pitch']), -100, 101, 1, 1, 1)
+
+ volume_adj = gtk.Adjustment(float(speech_config['volume']), 0, 201, 1, 1, 1)
+ rate_adj = gtk.Adjustment(float(speech_config['rate']), 80, 371, 1, 1, 1)
+ pitch_adj = gtk.Adjustment(float(speech_config['pitch']), 0, 100, 1, 1, 1)
+
volume_hscale = gtk.HScale(volume_adj)
rate_hscale = gtk.HScale(rate_adj)
@@ -246,39 +250,39 @@ class ListenSpell(activity.Activity):
rate_hscale.set_update_policy(gtk.UPDATE_DISCONTINUOUS)
pitch_hscale.set_update_policy(gtk.UPDATE_DISCONTINUOUS)
- voice_box = gtk.combo_box_new_text()
- voice_list = ["MALE1", "MALE2", "MALE3", "FEMALE1", "FEMALE2", "FEMALE3", "CHILD_MALE", "CHILD_FEMALE"]
- #hscale4 = gtk.HScale(adj4)
- for voice in voice_list:
- voice_box.append_text(voice)
+ #voice_box = gtk.combo_box_new_text()
+ #voice_list = ["MALE1", "MALE2", "MALE3", "FEMALE1", "FEMALE2", "FEMALE3", "CHILD_MALE", "CHILD_FEMALE"]
+ ##hscale4 = gtk.HScale(adj4)
+ #for voice in voice_list:
+ #voice_box.append_text(voice)
- try:
- voice_index = voice_list.index(speech_config['voice'])
- except ValueError:
- voice_box.set_active(0)
- else:
- voice_box.set_active(voice_index)
+ #try:
+ #voice_index = voice_list.index(speech_config['voice'])
+ #except ValueError:
+ #voice_box.set_active(0)
+ #else:
+ #voice_box.set_active(voice_index)
volume_label = gtk.Label("Volume")
rate_label = gtk.Label("Rate")
pitch_label = gtk.Label("pitch")
- voice_label = gtk.Label("Voice")
+ #voice_label = gtk.Label("Voice")
volume_adj.connect('value_changed',self._update_configuration, "volume")
rate_adj.connect('value_changed',self._update_configuration, "rate")
pitch_adj.connect('value_changed',self._update_configuration, "pitch")
- voice_box.connect('changed', self._update_configuration, "voice")
+ #voice_box.connect('changed', self._update_configuration, "voice")
config_table.attach(volume_label, 0,1,0,1)
config_table.attach(rate_label, 0,1,1,2)
config_table.attach(pitch_label, 0,1,2,3)
- config_table.attach(voice_label, 0,1,3,4)
+ #config_table.attach(voice_label, 0,1,3,4)
config_table.attach(volume_hscale, 1,2,0,1)
config_table.attach(rate_hscale, 1,2,1,2)
config_table.attach(pitch_hscale, 1,2,2,3)
- config_table.attach(voice_box, 1,2,3,4)
+ #config_table.attach(voice_box, 1,2,3,4)
speech_test_frame = gtk.Frame("Test Speech Setting")
@@ -314,16 +318,11 @@ class ListenSpell(activity.Activity):
elif response == gtk.RESPONSE_CANCEL:
#print "going back"
for k in speech_config:
- #print k + " " + str(previous_speechd_config[k])
- self.las.speechd_config(k, speech_config[k])
+ #print k + " " + str(previous_espeak_config[k])
+ self.las.espeak_config(k, speech_config[k])
self.config_dialog.destroy()
self.text_input.grab_focus()
-
-
-
- def get_speechd_config(self):
- pass
def submit_button_clicked(self, widget, data = None):
answer = self.text_input.get_text()
@@ -409,7 +408,7 @@ class ListenSpell(activity.Activity):
#label.set_use_underline(True)
table.attach(label, 0, 1, 0, 1)
- skill_level_adj = gtk.Adjustment(float(self.las.get_skill_level()), 0,16,1,1,1)
+ skill_level_adj = gtk.Adjustment(float(self.las.get_skill_level()), 1,16,1,1,1)
skill_level_scale = gtk.HScale(skill_level_adj)
skill_level_scale.set_digits(0)
skill_level_scale.set_update_policy(gtk.UPDATE_DISCONTINUOUS)