Ok, if we will use EOS message, we don't need add the end marl anymore.<div>I think i had used this mark, because iin my previous test,</div><div>didn't received the EOS signal at times, But now I tested it again and received the message, then I am ok with doing the change.</div>
<div>A updated patch should be:</div><div><br></div><div><div>diff --git a/src/jarabe/model/speech.py b/src/jarabe/model/speech.py</div><div>index ffc108c..1cb0ad4 100644</div><div>--- a/src/jarabe/model/speech.py</div><div>
+++ b/src/jarabe/model/speech.py</div><div>@@ -169,18 +169,20 @@ class _GstSpeechPlayer(gobject.GObject):</div><div> </div><div>         bus = self._pipeline.get_bus()</div><div>         bus.add_signal_watch()</div><div>-        bus.connect('message::element', self.__pipe_message_cb)</div>
<div>+        bus.connect('message', self.__pipe_message_cb)</div><div> </div><div>     def __pipe_message_cb(self, bus, message):</div><div>-        if message.structure.get_name() == 'espeak-mark' and \</div>
<div>-                message.structure['mark'] == 'end':</div><div>+        if message.type == gst.MESSAGE_EOS:</div><div>+            self._pipeline.set_state(gst.STATE_NULL)</div><div>+            self.emit('stop')</div>
<div>+        elif message.type == gst.MESSAGE_ERROR:</div><div>+            self._pipeline.set_state(gst.STATE_NULL)</div><div>             self.emit('stop')</div><div> </div><div>     def speak(self, pitch, rate, voice_name, text):</div>
<div>         # TODO workaround for <a href="http://bugs.sugarlabs.org/ticket/1801">http://bugs.sugarlabs.org/ticket/1801</a></div><div>         if not [i for i in text if i.isalnum()]:</div><div>             return</div>
<div>-        text = text + '<mark name="end>"></mark>'</div><div> </div><div>         self.make_pipeline('espeak name=espeak ! autoaudiosink')</div><div>         src = self._pipeline.get_by_name('espeak')</div>
<div>-- </div><div>1.7.10.1</div></div><div><br></div>