founder-of-mak-academy / jarvis-ai Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello sir i have a problem with the Jarvis coding. My code takes in input, recognizes input but doesn't give out voice output
import pyttsx3 #pip install pyttsx3
import speech_recognition as sr
import datetime
import wikipedia
engine = pyttsx3.init()
def speak(audio):
engine.say(audio)
engine.runAndWait()
def time_():
Time=datetime.datetime.now().strftime('%I:%M:%S')
speak ("The current time is")
speak(Time)
def date_():
year = datetime.datetime.now().year
month = datetime.datetime.now().month
date = datetime.datetime.now().day
speak("The current date is")
speak(date)
speak(month)
speak(year)
def wishme():
speak("Welcome back Mac-Roy!")
time_()
date_()
#greetings
hour = datetime.datetime.now().hour
if hour>=6 and hour<12:
speak("Good Morning Sir!")
elif hour>=12 and hour<18:
speak("Good Afternoon Sir!")
elif hour>=18 and hour<24:
speak("Good Evening Sir!")
else:
speak("Good Night Sir!")
speak("Jarvis at your service")
speak("What can i do for you sir?")
def TakeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
r.pause_threshold = 1
audio = r.listen(source)
try:
print("Recognizing...")
query = r.recognize_google(audio, language='en-pk')
print(query)
except Exception as e:
print(e)
print("Say that again please...")
return "None"
return query
if name == "main":
wishme()
while True:
query = TakeCommand().lower()
#All commands will be stored in lower case in query
#for easy recognition
if 'time' in query: #tells the time when asked
time_()
elif 'date' in query: #tells date when asked
date_()
elif 'wikipedia' in query:
speak("Searching........")
query=query.replace('wikipedia','')
result=wikipedia.summary(query,sentences=3)
speak('According to wikipedia')
print(result)
speak(result)
Traceback (most recent call last):
File "C:\Users\kille\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pywhatkit\main.py", line 322, in
file = open("pywhatkit_dbs.txt", "r", encoding='utf-8')
FileNotFoundError: [Errno 2] No such file or directory: 'pywhatkit_dbs.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:/Users/kille/Desktop/Seb stan AI/Seb Stan AI.py", line 20, in
import pywhatkit as kit
File "C:\Users\kille\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pywhatkit_init_.py", line 8, in
from pywhatkit.main import print_sleep_time, check_window, sendwhatmsg, sendwhatmsg_to_group, info, playonyt, search, close_tab, sendwhatmsg_instantly, sendwhats_image
File "C:\Users\kille\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pywhatkit\main.py", line 325, in
with open("pywhatkit_dbs.txt", "w", encoding="utf-8") as file:
PermissionError: [Errno 13] Permission denied: 'pywhatkit_dbs.txt'
I am facing this error, can someone please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.