當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。