-
Notifications
You must be signed in to change notification settings - Fork 1
/
interface.py
53 lines (47 loc) · 1.13 KB
/
interface.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
import audio_fn as ad
import time
import feature
#start
name="name"
def start():
hour= int(time.strftime("%H"))
print hour
if (hour>5 and hour <12):
ad.tts("Good morning")
elif (hour>12 and hour <16):
ad.tts("Good afternoon")
else:
ad.tts("Good evening")
ad.tts("May i know your good name?")
global name
name=str(ad.stt())
print name
ad.tts("Hello "+str(name)+", I am Amina. your helper.")
return
def which_mode():
while (1):
wh=ad.stt()
if wh is None:
ad.tts( "try again")
continue
if ad.find(wh,"read"):
ad.tts("ok, I am ready to assist you in reading.")
a= feature.main(1)
return a;
elif ( ad.find(wh,"sketch") or ad.find(wh,"draw") ):
ad.tts("ok, I am ready to assist you in sketching.")
#sketch()
return;
elif ( ad.find(wh,"note") or ad.find(wh,"write") ):
ad.tts("ok, I am ready to assist you in taking notes.")
#note()
return;
else:
ad.tts("Sorry, I didn't get you. Are you reading or sketching or taking notes?")
which_mode()
if __name__ == "__main__":
start()
# configure()
ad.tts(str(interface.name)+", What do you intend to do?")
which_mode()
# dict_crop()