Espeak-ng is not working on windows

I cant get espeak to work on windows. Now lm getting a file not found error on. Say(). Someone pleaye help

I assume that you are calling Say in python is that right?
I also assume that you must install espeak ng on windows for this to work.

Looking on PyPI it was not clear to me if there is a maintained package for espeak ng.

Does anyone else have experience of how to get this working?

Yes, thank you. But l’ve installed it and its still not wirking

Maybe some details would help others to help you.

For instance (but not limited to):

  • What did you install? (“it” doesn’t really confirm enough for someone to know what you actually installed)
  • What steps did you take?
  • Did you install it within a virtual environment?
  • What was output during the install and did anything indicate a success/possible issues?

Thank you Neil

I downloaded espeak-ng-1.50 X 64 and installed it. Then installed py-espeak-ng, python -m pipenv install py-espeak-ng. Then I wrote the following code:
import espeakng
mySpeaker = espeakng.ESpeakNG()
mySpeaker.say(‘Initializing Baxter’)

And then I got the error below:
return self.espeak_exe(args, sync=sync)
File "C:\Users\Athene.virtualenvs\bossSpy-hSNR6CEY\lib\site-packages\espeakng_init
.py", line 66, in _espeak_exe
p = subprocess.Popen(cmd,
File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\subprocess.py”, line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

1 Like

Given that the error seems to originate with a file not found as part of a subprocess call, I wonder if you haven’t actually got espeak-ng installed and present in your path.

Maybe you just installed the python package for it but not the underlying tool that’s needed for the python package to work (as it appears to be just a wrapper)

If you check the Requirements section on PyPI (py-espeak-ng · PyPI ) it does specifically mention this needs to be done, and crucially as well as installing you also need to be sure it’s in the Path.

Therefore perhaps see if that’s what’s going wrong. If you have espeak-ng properly installed, you should be able to run it straight from the command line from anywhere - testing that works is a good start.

If that works and you still have issues with the Python package then further things will need to be looked into.

Hope that helps!

Thank you Neil,

espeak-ng is included in the Appdata path variable, but I am still getting the same error.

I also added shell=True on the subprocess, now there’s no error its just quiet

After a few hours I restarted VS code and it picked up the environment variable. Hopefully this helps someone.

As for the .say() it never uttered a word so in the end I opted for this line instead, it works:
os.system(‘espeak-ng “say my name”’)

1 Like

Glad you managed to get things working in some form at least, even though the say() approach isn’t working :+1: