python 中文语音代码

#-*- coding: UTF-8 -*-
import sys
import pyttsx
reload(sys)
sys.setdefaultencoding("utf-8")
text = 'python-opencv人脸识别与树莓派摄像头转头跟随'
engine = pyttsx.init()

# voice = engine.getProperty('voice')
# print voice
engine.say(text)
engine.runAndWait()

 

image