I'm implementing a simple program for Text-to-speech conversion using the python library pyttsx. It's working fine and uttering all given text as expected but after completion of execution it's not returning to terminal prompt. It is also returning None
as name parameter from methods.
The following is the code of the python script.
#!/usr/local/bin/python
import pyttsx
engine = pyttsx.init()
def onStart(name):
print 'Starting', name
def onWord(name, location, length):
print 'word', name, location, length
def onEnd(name, completed):
print 'finishing', name, completed
engine.stop()
engine.connect('started-utterance', onStart)
engine.connect('started-word', onWord)
engine.connect('finished-utterance', onEnd)
engine.say('The quick brown fox jumped over the lazy dog')
engine.runAndWait()