forked from linzhuoliSOC/IG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest1.py
executable file
·29 lines (26 loc) · 917 Bytes
/
test1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from flask import Flask, render_template, request, redirect, url_for
import time
import re
from random import randint
import pyttsx
engine = pyttsx.init()
voices = engine.getProperty('voices')
#print voice
#engine.setProperty('gender', 'male')
# for voice in voices:
# if voice.gender == "male":
# engine.setProperty('voice', voice.id)
# print "yes!"
# break
engine.setProperty('voice',u'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_DAVID_11.0')
engine.say("Yeahyeah! First of all, this folly is gorgeous, well, my answer to your question is autocatalysis")
# engine.runAndWait()
# # for voice in voices:
# # print voice.gender
# #engine = pyttsx.init()
for voice in voices:
#voices = engine.getProperty('voices')
engine.setProperty('voice', voice.id)
print voice.id
# engine.say("this folly is gorgeous")
engine.runAndWait()