当前位置: 首页>>代码示例>>Python>>正文


Python pyttsx.init方法代码示例

本文整理汇总了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 
开发者ID:m4n3dw0lf,项目名称:Jarvis,代码行数:24,代码来源:brain.py

示例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 
开发者ID:m4n3dw0lf,项目名称:NetGUARD,代码行数:17,代码来源:jarvis.py

示例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() 
开发者ID:m4n3dw0lf,项目名称:NetGUARD,代码行数:8,代码来源:jarvis.py

示例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() 
开发者ID:osrf,项目名称:rosbook,代码行数:13,代码来源:pyttsx_server.py

示例5: __init__

# 需要导入模块: import pyttsx [as 别名]
# 或者: from pyttsx import init [as 别名]
def __init__(self):
        self.pyttsx = pyttsx.init()
 
    # convert text to speech 
开发者ID:rdmilligan,项目名称:SaltwashAR,代码行数:6,代码来源:texttospeech.py

示例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() 
开发者ID:Shobhit20,项目名称:Image-Captioning,代码行数:17,代码来源:test.py


注:本文中的pyttsx.init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。