-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
41 lines (32 loc) · 1.17 KB
/
Main.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
# -----------------------imports-----------------
import Voice_Recognition as streaming
import pyttsx
# -----------------------------------------------
"""
was not sure wether to use sphinx or google cloud decided on google because sphinx was very bad
"""
# ------------------------variables--------------
name = "Amy"
key="AIzaSyBZh4ZPUWldAfTciUCIVaFA9NsTaFjcVw4"
# -----------------------------------------------
# ------------------------commands---------------
class command_class(object):
def __init__(self, command):
self.engine=pyttsx.init()
self.command = command
self.command_analyzer()
def command_analyzer(self):
if name + " say hello world" in self.command:
self.hello_world()
###TODO create function to analyze the command and send it on its way example: internal something that doesnt use internet
def hello_world(self):
self.engine.say("Hey There")
self.engine.runAndWait()
#--------------------------------------------------
def main():
while True:
command = streaming.main()
if name in command:
x = command_class(command)
if __name__ == '__main__':
main()