pyttsx3
pyttsx3 copied to clipboard
Configuring espeak driver on MacOS
Hello, I have installed and configured pyttsx3
on my macOS. And by default it uses nsss
as driver and this setting works fine. However when I change the driver to espeak
I'm unable to get any sound from the driver.
So by default you should have the following error on macOS:
'libespeak.so.1' (no such file)
To solve it I have installed espeak from the brew
and linked it's libraries to the missing file:
- I have installed
espeak
using homewbew formula. I did also check thatespeak
works
brew install espeak
espeak "This is a test"
- I have created the symlink
libespeak.so.1
to alibespeak.dlyb
file. As far as I understood thebrew
renamed.so.1
to.dlyb
.
ln -s /opt/homebrew/Cellar/espeak/1.48.04_1/lib/libespeak.dylib libespeak.so.1
Now I don't get errors on missing 'libespeak.so.1', but I unfortunately can't hear any voice during execution:
import pyttsx3
engine = pyttsx3.init('espeak', debug=True)
voices = engine.getProperty('voices')
engine.setProperty('voice',voices[11].id) #English
engine.say('Hello sir, how may I help you, sir.')
engine.runAndWait()
So, am I missing something here? Is this solvable?