python 用pyttsx實現語音

要用到pyttsx庫 https://pypi.python.org/pypi/pyttsx


示例:

#coding:utf-8

import pyttsx

eng1 = pyttsx.init()
eng1.say('Sally sells seashells by the seashore')
eng1.say(u'不知道')
eng1.runAndWait()

eng1.say('Sally sells seashells by the seashore')
eng1.say(u'不知道')
eng1.runAndWait()


多加空格不會有停頓效果

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章