forked from nateshmbhat/pyttsx3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue "'Started-word' event does not work correctly nateshmbhat#78"…
… in sapi5 driver for win.
- Loading branch information
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
447a473
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the below are:
"stream_number" is not accessed
"stream_position" is not accessed
Can that be the reason that the output of:
"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()"
is still:
"word None 1 0
word None 0 3
word None 4 5
word None 10 5
word None 16 3
word None 20 6
word None 27 4
word None 1 40480
word None 1 40480"
def _ISpeechVoiceEvents_EndStream(self, stream_number, stream_position):
d = self._driver
if d._speaking:
d._proxy.notify('finished-utterance', completed=not d._stopping)
d._speaking = False
d._stopping = False
d._proxy.setBusy(False)
def _ISpeechVoiceEvents_Word(self, stream_number, stream_position, char, length):
self._driver._proxy.notify(
'started-word', location=char, length=length)