-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtext_to_voice1.py
56 lines (52 loc) · 1.91 KB
/
text_to_voice1.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import pyttsx3
engine = pyttsx3.init()
rate = engine.getProperty('rate')
volume = engine.getProperty('volume')
voices = engine.getProperty('voices')
engine.setProperty('rate',123)
engine.setProperty('volume',1.0)
engine.setProperty('voice',voices[0].id)
keypoint_score_Nose= 0.35
keypoint_score_LEye= 0.134
keypoint_score_REye= 0.134
keypoint_score_LEar= 0.34556
keypoint_score_REar= 0.2
keypoint_score_LShoulder= 0.35
keypoint_score_RShoulder= 0.35
keypoint_score_LElbow= 0.15
keypoint_score_RElbow= 0.5
keypoint_score_LWaist= 0.334
keypoint_score_RWaist= 0.35
keypoint_score_LHip= 0.003
keypoint_score_RHip= 0.1
keypoint_score_LKnee= 0.15
keypoint_score_RKnee= 0.55
keypoint_score_LAnkle= 0.45
keypoint_score_RAnkle= 0.15
#Left Side of Body
if keypoint_score_LAnkle>0.25:
engine.say("Your Left Ankle is not in correct position")
if keypoint_score_LKnee>0.25:
engine.say("Your Left knee is not in correct position")
if keypoint_score_LHip>0.25:
engine.say("Your Left Hip is not in correct position")
if keypoint_score_LWaist>0.25:
engine.say("Your Left Waist is not in correct position")
if keypoint_score_LElbow>0.25:
engine.say("Your Left Elbow is not in correct position")
if keypoint_score_LShoulder>0.25:
engine.say("Your Left Shoulder is not in correct position")
#Right Side of Body
if keypoint_score_RAnkle>0.25:
engine.say("Your Right ankle is not in correct position")
if keypoint_score_RKnee>0.25:
engine.say("Your Right Knee is not in correct position")
if keypoint_score_RHip>0.25:
engine.say("Your Right hip is not in correct position")
if keypoint_score_RWaist>0.25:
engine.say("Your Right Waist is not in correct position")
if keypoint_score_RElbow>0.25:
engine.say("Your Right Elbow is not in correct position")
if keypoint_score_RShoulder>0.25:
engine.say("Your Right Shoulder is not in correct position")
engine.runAndWait()