-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtalker.py
More file actions
21 lines (16 loc) · 702 Bytes
/
talker.py
File metadata and controls
21 lines (16 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from listener import wait_for_wake_word, listen_for_command
from speaker import speaker
from geminitalker import talker
print("🤖 Assistant is running. Say 'Hello Assistant' to start talking. Say 'assistant off' to stop.\n")
while True:
if wait_for_wake_word(): # Wait until wake word is heard
while True: # Inner loop: take continuous commands
text = listen_for_command()
if text is None:
continue
if "assistant off" in text.lower():
print("assistant turned off.")
speaker("Goodbye! Assistant turned off.")
exit()
response = talker(text)
speaker(response)