#!/usr/bin/python3
import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
When i am running this above code on my server CentOS 7, it is showing no output. I just want to know how would I get sound at client side when its playing on server side.
Another try:
When I am runnning this below code:
#!/usr/bin/python3
#print("Content-type: text/html")
print("")
import pyttsx3
import comtypes
engine = pyttsx3.init('sapi5') # <--- sapi 5 is for Win 10
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
It gives error:
Traceback (most recent call last):
File "test_speech.py", line 7, in <module>
import comtypes as ctypes
File "/usr/local/lib/python3.6/site-packages/comtypes/__init__.py", line 23, in <module>
from _ctypes import COMError
ImportError: cannot import name 'COMError'