nateshmbhat / pyttsx3

Offline Text To Speech synthesis for python
Mozilla Public License 2.0
2.11k stars 331 forks source link

windows10 pyttsx3.init -> sap15.py -.>win32com -> DLL load failed #13

Closed nickums closed 6 years ago

nickums commented 6 years ago

After reviewing the issues, I have just done the following: in sequence: install Python36, install pyinstaller, install pypiwin32, install pyttsx3
Disappointingly, pyttsx3.init() fails as follows - ...... File "C:\Python\Python35\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in import win32com.client File "C:\Python\Python35\lib\site-packages\win32com__init__.py", line 5, in import win32api, sys, os ImportError: DLL load failed: %1 is not a valid Win32 application.

Help wanted!

josephalway commented 6 years ago

fixed / workaround for pyttsx3 test won't work once compiled with pyinstaller

and

pyttsx3 fails to execute when compiled

Fix is to create a hook for pyttsx3 in pyinstaller hooks folder and keep pyi_rth_win32comgenpy.py from running on python >= v3.

The problem isn't in pyttsx3, it's in pyinstaller.

nickums commented 6 years ago

Thanks! applied your fix and it now works perfectly. very satisfied that it uses the Windows default sapi15 voice MARY rather than the rather robotic espeak.