本文整理汇总了Python中pyttsx.init方法的典型用法代码示例。如果您正苦于以下问题:Python pyttsx.init方法的具体用法?Python pyttsx.init怎么用?Python pyttsx.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyttsx
的用法示例。
在下文中一共展示了pyttsx.init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import pyttsx [as 别名]
# 或者: from pyttsx import init [as 别名]
def __init__(self):
self.status = 1
self.version = "0.0.7"
self.array = []
self.numbers = []
self.path = os.path.abspath(os.path.dirname(sys.argv[0]))
try:
self.con = sqlite3.connect(self.path + "config/Jarbas.db")
except:
g = self.path.split("core")
dbpath = g[0] + "/config/Jarbas.db"
self.con = sqlite3.connect(dbpath)
self.serialport = self.arduino_check()
self.rec = sr.Recognizer()
self.engine = pyttsx.init()
self.rate = self.engine.getProperty('rate')
self.engine.setProperty('rate', self.rate-60)
self.voices = self.engine.getProperty('voices')
self.engine.setProperty('voice',self.voices[16].id) #1,9,10,11,16,22,25
self.ser = serial.Serial()
self.ser.port = self.serialport
self.ser.baudrate = 9600
示例2: __init__
# 需要导入模块: import pyttsx [as 别名]
# 或者: from pyttsx import init [as 别名]
def __init__(self):
self.version = "0.0.6"
self.array = []
self.numbers = []
self.con = None # example sqlite3.connect('config/database.db');
self.serialport = self.arduino_check()
self.rec = None #sr.Recognizer()
self.engine = pyttsx.init()
self.rate = self.engine.getProperty('rate')
self.engine.setProperty('rate', self.rate-65)
self.voices = self.engine.getProperty('voices')
self.engine.setProperty('voice',self.voices[16].id) #1,9,10,11,16,22,25
self.ser = serial.Serial()
self.ser.port = self.serialport
self.ser.baudrate = 9600
示例3: Jarvis
# 需要导入模块: import pyttsx [as 别名]
# 或者: from pyttsx import init [as 别名]
def Jarvis(self, text):
self.string = str(text)
self.engine = pyttsx.init()
self.engine.connect('finished-utterance', self.onEnd)
self.engine.say(self.string)
self.engine.startLoop()
示例4: __init__
# 需要导入模块: import pyttsx [as 别名]
# 或者: from pyttsx import init [as 别名]
def __init__(self, node_name, action_name):
rospy.init_node(node_name)
self.server = actionlib.SimpleActionServer(action_name, TalkAction,
self.do_talk, False)
self.engine = pyttsx.init()
self.engine_thread = threading.Thread(target=self.loop)
self.engine_thread.start()
self.engine.setProperty('volume', rospy.get_param('~volume', 1.0))
self.engine.setProperty('rate', rospy.get_param('~rate', 200.0))
self.preempt = rospy.get_param('~preempt', False)
self.server.start()
示例5: __init__
# 需要导入模块: import pyttsx [as 别名]
# 或者: from pyttsx import init [as 别名]
def __init__(self):
self.pyttsx = pyttsx.init()
# convert text to speech
示例6: text
# 需要导入模块: import pyttsx [as 别名]
# 或者: from pyttsx import init [as 别名]
def text(img):
t1= time.time()
encode = ei.model_gen()
weight = 'Output/Weights.h5'
sd = SceneDesc.scenedesc()
model = sd.create_model(ret_model = True)
model.load_weights(weight)
image_path = img
encoded_images = ei.encodings(encode, image_path)
image_captions = tm.generate_captions(sd, model, encoded_images, beam_size=3)
engine = pyttsx.init()
print image_captions
engine.say( str(image_captions))
engine.runAndWait()