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
'Started-word' event does not work correctly #78
Comments
I just installed with pip3 and am getting the same error! What version does this work in? How do I get my pip3 to install that version? Help! |
can u please install 2.71 version and report back here if its working ? |
Tried that but then I get a bunch of these: |
It looks like something related to ur sound card. I think there was some similar issue raised related to sound card. I don't remember the title of it unfortunately. |
Its a raspberry pi 3 b+, sound card works fine, but all versions of this software older than 2.8 or so give those alsa errors, and the 2.8 or above ones don't respond correctly to started-word, but seem to work fine in all other respects. Unfortunately this renders started-word event unusable with pyttsx3 on raspbian buster unless I want to figure out what versions of what softwares and libraries I have to roll back in order to get older versions of pyttsx3 to work. Perhaps if I run it before running apt-get upgrade for example, not sure, just trying this out but unfortunately can't use started-word right now. |
Update ALSA errors seem to be related to https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=241814 and trying that fix got it sorta working. I still get a bunch of ALSA errors but not nearly as many and it actually speaks, and actually stops, so yea started-word works in 2.7 if that helps. |
Spoke too soon on ALSA working but started-word seems to function fine. At this point for me I'm in over my head on this so going back to later version and waiting for fix for started-word. |
Is this working now in the latest version? |
Sorry If I confused the issues, the started-word event does not work with Python3 and pyttsx3 2.87. The event seems to work with Python2.7 which is using pyttsx3 2.7 however with that combination I get ALSA errors, and inconsistent behavior at best. |
same issue: |
same problem here, it's not fixed yet. |
same problem here, it's not fixed yet. |
I am using I was also having issues where my tts would not use the connect "started-word" callback. After edits 1 and 2, that fixed it for me changing the voice flags and sapi.py file were needed. I can now properly use the connect() function to break mid utterance but struggle to get it to work after 1 break. I am stuck on restarting the tts properly. If at anypoint I use engine. endloop() or engine.stop() I can't get it to start up again |
… in sapi5 driver for win.
This is still not fixed in pyttsx3 v2.90 on Windows 11! Edit: I was able to get it to work by manually pasting the latest version of sapi5.py into my version. Pip installed an out dated version of it for some reason. |
There are two problems in code:
Bonus stage |
This issue still exists in the latest version. I've also tried the aforementioned solutions, but it still does not work. Windows 10 EDIT: I fixed the issue by replacing my pyttsx3 external library with a downloaded version from here |
In the latest version of pyttsx3 the 'started-word' event does not seem to work correctly anymore. Running the following sample code from the documentation produces the output below.
Output from newest pyttsx3:
Running the same code with the pyttsx3 version from pip results in the following output:
I suspect it has something to do with the recent changes in #75 but unfortunately I was not able to fix it myself.
Edit 1
Checking the documentation of sapi I found that
_ISpeechVoiceEvents_StartStream(self, char, length)
in sapi5.py should probably be_ISpeechVoiceEvents_Word(self, stream, pos, char, length)
. However, the callback of the 'started-word' event is still not executed when starting a word but rather at the very end of the sentence.Edit 2
By digging around in the documentation I learned about the SpeechVoiceSpeakFlags . It seems like the following changes fix the problem, but I'm not sure if this is the proper way to do it. Since I am unsure about the changes and because I have never done a pull request before, I just listed them below.
Speak the given text string asynchronously (SpVoice Flag 1):
Purge all pending speak requests prior to this speak call to stop engine (SpVoice Flag 2):
The text was updated successfully, but these errors were encountered: