pyttsx3 cannot wrap

1. pyttsx3 under python3 can be used normally, similar to the following:

import pyttsx3
engine = pyttsx3.init()
rate = engine.getProperty('rate')
engine.setProperty('rate', rate-60)
engine.say('123')
engine.runAndWait()

2. But once it is packaged into exe with pyinstaller, the operation will prompt

        1. pyttsx3.drivers module not found

        

     2. Adding from pyttsx3.drivers import sapi5 to dreiver.py (pyttsx3 configuration file) will still prompt the error.


3. Take a closer look at the drivers module called under win is sapi5, which still encapsulates the module win32com.client.Dispatch ('SAPI.SPVoice'), you can directly use win32com.client to rewrite the package yourself, without the pyttsx3 module.

        

            


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324583903&siteId=291194637