Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/clock.py
diff options
context:
space:
mode:
authorGary C Martin <gary@garycmartin.com>2012-06-12 21:28:08 (GMT)
committer Gary C Martin <gary@garycmartin.com>2012-06-12 21:28:08 (GMT)
commit943293fc8923808d1524114a3480db042a38ffc7 (patch)
tree5e3a4a4d96fac8ffa02dc15130d9dc59bed08472 /clock.py
parent391cf67ce3d9bb04b0e33444afc0fb077ecd12a6 (diff)
Fix for using incorrect spoken accent when using gstreamer-espeak plugin SL#687
Diffstat (limited to 'clock.py')
-rwxr-xr-xclock.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/clock.py b/clock.py
index 82b9da2..5332262 100755
--- a/clock.py
+++ b/clock.py
@@ -437,7 +437,16 @@ class ClockActivity(activity.Activity):
if message.type in (gst.MESSAGE_EOS, gst.MESSAGE_ERROR):
pipe.set_state(gst.STATE_NULL)
- pipeline = 'espeak text="%s" ! autoaudiosink' % self._untag(self._time_in_letters)
+ if self._time_speaker is None:
+ self._time_speaker = Speaker()
+
+ pipeline = 'espeak text="%(text)s" voice="%(voice)s" pitch="%(pitch)s" \
+ rate="%(rate)s" gap="%(gap)s" ! autoaudiosink' % {
+ 'text':self._untag(self._time_in_letters),
+ 'voice':self._time_speaker.VOICE,
+ 'pitch':self._time_speaker.PITCH,
+ 'rate':self._time_speaker.SPEED,
+ 'gap':self._time_speaker.WORD_GAP}
try:
pipe = gst.parse_launch(pipeline)
bus = pipe.get_bus()
@@ -445,8 +454,6 @@ class ClockActivity(activity.Activity):
bus.connect('message', gstmessage_cb, pipe)
pipe.set_state(gst.STATE_PLAYING)
except:
- if self._time_speaker is None:
- self._time_speaker = Speaker()
self._time_speaker.speak(self._untag(self._time_in_letters))
def _untag(self, text):