0

pyttsx3.init().stop() function not working.

I was finding a way to stop pyttsx3.innit.say() function and came across its documentation. And I got to know that it has a stop function given in an example. So I ran the code but it doesn't do anything. Also the code provided in the website has some errors too, like missing parentheses.

Coded provided on website:-

import pyttsx3
def onWord(name, location, length):
   print 'word', name, location, length
   if location > 10:
      engine.stop()
engine = pyttsx3.init()
engine.connect('started-word', onWord)
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait()
Vatsal
  • 16
  • 4

0 Answers0