Skip to content

Commit

Permalink
Update alpha test 0.1.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ParramNainani committed Jan 31, 2024
1 parent 21cd197 commit 0880805
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions alpha test 0.1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
import time
import os
from datetime import datetime

## MODULES


n=0
def voice():
def voice(): ## TO SETUP THE VOICE
import datetime
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
engine.setProperty('voice', voices[0].id) ## CHANGE THE NUMBER TO CHANGE THE VOICE
def speak(audio):
engine.say(audio)
engine.runAndWait()
def wishme():
def wishme(): ## USED FOR A WISHING EFFECT MORNING , AFTERNOON OR EVENING
hour = int(datetime.datetime.now().hour)
if hour>= 0 or hour<12 :
speak("Good Morning")
Expand All @@ -27,7 +31,7 @@ def wishme():
speak("Good evening")
speak("Hi Mr. Param Nainani , What's good")

def takeCommand():
def takeCommand():## FOR RECOGNIZING WHAT THE PERSON IS SAYING
r=sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
Expand All @@ -46,7 +50,7 @@ def takeCommand():
wishme()

while True:
query = takeCommand()
query = takeCommand() ## IMP STEP TO ASSIGN WHAT THE USER IS SAYING TO A VARIABLE NAMED QUERY

if 'who is' in query:
speak("Searching wikipedia...")
Expand Down Expand Up @@ -87,7 +91,7 @@ def takeCommand():
print("Good to know sir")
else:
print("uh huh")
def face():
def face():
global n
path = r"C:\Users\Param Nainani\OneDrive\Documents\ImagesAttendence"
images = []
Expand Down Expand Up @@ -166,4 +170,4 @@ def work():
else:
print('NOT MR.PARAM NAINANI USER ACCESS DENIED')
break
face()
face()

0 comments on commit 0880805

Please sign in to comment.