Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAPI and NSSS word events #329

Merged
merged 3 commits into from
Sep 27, 2024
Merged

SAPI and NSSS word events #329

merged 3 commits into from
Sep 27, 2024

Conversation

willwade
Copy link
Collaborator

@willwade willwade commented Sep 26, 2024

If you run

import pyttsx3
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 = pyttsx3.init()
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()

on SAPI it was still broken. Im not sure how - but I think one of the PRs cancelled out our changes. Nay mind this PR is better now as we now get

starting None
word The 0 3
word quick 4 5
word brown 10 5
word fox 16 3
word jumped 20 6
word over 27 4
word the 32 3
word lazy 36 4
word dog. 41 4
finishing None True

This works on SAPI and NSSS (NB: It already worked on espeak)

@nateshmbhat
Copy link
Owner

Hey that's wonderful @willwade. Thanks will merge it

@nateshmbhat nateshmbhat merged commit 62108f3 into nateshmbhat:master Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants