-
Notifications
You must be signed in to change notification settings - Fork 3
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
eSpeak support #6
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: will wade <willwade@gmail.com>
anyone out there had a chance to test this?! |
Okay, but I need helping.
I guess I should uninstall existing py3-tts or even better try and run this from another machine?! |
UPDATE: IF ANYONE IS FOLLOWING AT HOME SEE MY UPDATED COMMENT BELOW!!
import pyttsx3
engine = pyttsx3.init('espeak')
voices = engine.getProperty('voices')
for voice in voices:
engine.setProperty('voice', voice.id)
engine.say('The quick brown fox jumped over the lazy dog.')
engine.runAndWait() Now in usual py3-tts does this work? In my experience at least it didnt. So now lets try my PR gh repo clone thevickypedia/py3-tts
cd py3-tts
git fetch origin pull/6/head:MASTER (or using your GitHub desktop app and getting the pull request 6) then try it out. You shouldnt have to uninstall py3-tts but if you want you can. the key is this cd py3-tts
pip install -e . now in the same shell session try our test.py If test.py works you can try other things like event loops eg 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('espeak')
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() What it should do? Work! Previously it just wouldnt sound out anything or complain about no dll/so file.. |
Hi, In the files I attached, So that at least makes me think that File 2. Chances are that I can get this working on an older laptop where I suppose I didn't install any pyttsx3 yet so that on an empty ground it doesn't get confused. |
My bad. try this Install eSpeak-ng https://github.com/espeak-ng/espeak-ng/blob/master/docs/guide.md#installation . if on a Mac just note the homebrew build out there isnt working on Apple Silicon - so you may need to install from source (its painless!) https://github.com/espeak-ng/espeak-ng/blob/master/docs/building.md (Same as last time) Now use virtualenv python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate` now pip install from my repo (this PR) pip install git+https://github.com/willwade/py3-tts.git@master#egg=py3-tts Save the below to a file eg 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('espeak')
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() run it python test_pyttsx3.py What should it do? Speak - but also print out
|
To avoid confusion, I just summarize the following steps to test
Fixed on Windows in my opinion! |
yay! many thanks. I've been testing this on windows and Linux. There are a LOT of open issues in pyttsx3 that relate to this so I like to think we have crushed a lot in this PR :) |
Docker - WIP - instructions https://gist.github.com/willwade/218ec9e356ae4c77b55ef282f051844d NB: Im no docker expert.. It will at least show you word timings emitted.. so something is working... |
NB: I dont mean to pile on any pressure but I'm looking at forking this repo to fix this issue more long term if this isnt accepted..(its causing headaches to keep linking to my repo in downstream projects needing eSpeak). there are so many forks of this library I dont really want to.. |
I know, and, as it is better to be honest, it'll be much better if someone else can test it on a recent Linux environment. |
@willwade thanks for these contributions |
yay. for sure! :) |
have published newer version with recent bug fix PRs merged to pyttsx3 in the latest version. Please check it out when you can 😃 |
eSpeak does have one remaining issue. WordEvents are emitted but they occur BEFORE the words are spoken aloud.(fixed here)Please check my code. I've had a lot of debug code in my work which I think I have stripped out