当我将python文件从py转换为.exe时,我的.exe文件显示错误

时间:2019-10-20 15:24:22

标签: python text-to-speech

我能够将此代码转换为.exe,但无法运行。 我已经使用cx_Freeze和pyinstaller进行了转换。

import pyttsx3 
engine = pyttsx3.init()

voices = engine.getProperty('voices')

engine = pyttsx3.init('sapi5')
engine.setProperty('voice', voices[0].id)

def speak(audio):
    engine.say(audio)
    engine.runAndWait()
    engine.setProperty('rate', 145) 
print('Hello sir!')
speak('Hello sir')
print('you can write or paste that you want to listen and press enter. \n')
speak('you can write or paste that you want to listen and press enter. ')
var = str(input('Paste your paragraph here\n:'))
print('Dictating your paragraph....\n\n')
speak(var)
print('Thankyou for using me')
speak('Thankyou for using me!')
engine.runAndWait()

请告诉我该怎么做? 或者自己动手

0 个答案:

没有答案