AI Voice Assistant
AI Voice Assistant
on
AI VOICE ASSISTANT
(J.A.R.V.I.S)
By
Submitted to
[1]
CERTIFICATE
I hereby declare that the work presented in this report entitled “AI Voice Assistant”
in partial fulfillment of the requirements for the Major Project(8th Semester) in
Computer Science and Engineering submitted in the department of Computer
Science & Engineering and Information Technology, Jaypee University of Information
Technology, Waknaghat is an authentic record of my own work carried out over a
period from Feb 2021 to May 2021 under the supervision of Dr. Mrityunjay Singh.
Amitesh Srivastava(171242)
This is certified to be the bonafied work of the students in the Major Project Lab
during academic year 2021.
Date – 18/05/2020
[2]
ACKNOWLEDGEMENT
[3]
TABLE OF CONTENTS:
List of Abbreviations
List of figures
List of Graphs
List of tables
ABSTRACT
1. INTRODUCTION
1.1 Introduction
1.2 Problem Statement
1.3 Objectives
1.4 Methodology
1.5 Organization
2. LITERATURE SURVEY
3. SYSTEM DEVELOPEMENT
4. PERFORMANCE ANALYSIS
5. CONCLUSIONS
5.1 Conclusions
5.2 Future Scope
5.3 Applications Contributions
REFERENCES
APPENDICES
[4]
List of Abbreviations
[5]
List of Figures
[6]
4.10 -> what is education google search
4.14 -> can you open the big bang theory series for me google search
[7]
List of Graphs No
graphs
List of Tables No
tables
[8]
ABSTRACT
The project aims to develop a personal-assistant for Linux-based systems. Jarvis
draws its inspiration from virtual assistants like Cortana for Windows, and Siri
for iOS. It has been designed to provide a user-friendly interface for carrying
out a variety of tasks by employing certain well-defined commands. Users can
interact with the assistant either through voice commands or using keyboard
input. As a personal assistant, Jarvis assists the end-user with day-to-day
activities like general human conversation, searching queries in google, bing or
yahoo, searching for videos, retrieving images, live weather conditions, word
meanings, searching for medicine details, health recommendations based on
symptoms and reminding the user about the scheduled events and tasks. The user
statements/commands are analysed with the help of machine learning to give an
optimal solution.
[9]
1. INTRODUCTION
1.1 Introduction
Just imagine having an A.I. right hand just like one in the movie Iron
man. Just think of it’s applications like sending e-mails without
opening up your mail, searching on Wikipedia and googling and
playing music on youtube without using your web browser, and other
date to day tasks done on a computer. In this project, we will
demonstrate how we can make our own A.I. associate using Python 3.
[10]
Chrome.
We are all well aware about Cortana, Siri, Google Assistant and many
other virtual assistants which are designed to aid the tasks of users
in Windows, Android and iOS platforms. But to our surprise,
there’s no such virtual assistant available for the paradise of
Developers i.e. Windows platform.
[11]
aim to develop a complete server assistant, by automating the
entire server management process - deployment, backups, auto-
scaling, logging, monitoring and make it smart enough to act as a
replacement for a 6 general server administrator.
1.3 Objectives
1.4 Methodology
o Jj
1.5 Organization
o Ll
o ;ll
[12]
2. LITERATURE SURVEY
[13]
functionality is working properly. We test this on 2 speakers(1
Female and 1 Male) for accuracy purpose.
-ShrutiKa Khobragade
3. SYSTEM DEVELOPEMENT
Modules used :
● pyttsx3 (imports voices and has functions related to
speaking)
● datetime (#not important .)
● speech_recognition (to convert speech to text)
● wikipedia (to access Wikipedia information)
● webbrowser (to manipulate web browsing operations)
● os (for just os.clear())
● pywhatkit (for playing songs on youtube)
Functions created :
● speak() (speaks text given as argument)
● wishMe (Wishes according to the day hour)
● takeCommand() (to convert speech to text and give it as
input )
[14]
● indices(), openwebsite(), printspeak() are functionss
just to shorten the code therefore, not important.
Working:
What is pyttsx3?
Fig. 3.1
What is sapi5?
Is VoiceId?
1. speak()
[15]
The most importantly thing for an A.I. right hand is that it should
have the option to talk. To make our J.A.R.V.I.S. talk, we will
make a capacity called talk. This capacity will accept sound as
a contention,and afterward, it will articulate it.
Fig. 3.2
2. wishMe()
The most importantly thing for an A.I. right hand is that it should
have the option to talk. To make our J.A.R.V.I.S. talk, we will
make a capacity called talk. This capacity will accept sound as
a contention,and afterward, it will articulate it.
Fig. 3.3
3. takeCommand()
[16]
Fig. 3.4
Fig. 3.5
On the off chance that 'wikipedia' in inquiry: #if wikipedia found in the
question then this square will be executed
[17]
Fig. 3.6
Fig. 3.7
Fig. 3.8
Fig. 3.9
[18]
Characterizing Task 5: To ask basic questions
Fig. 3.10
Fig. 3.11
[19]
Complete code:
import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import webbrowser
import os
import pywhatkit
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty('voice',voices[1].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
def wishMe():
hour=int(datetime.datetime.now().hour)
return('Good morning')
[20]
return("Good afternoon")
else:
return("Good evening")
def takeCommand():
r = sr.Recognizer()
r.adjust_for_ambient_noise(source2, duration=0.2)
print('Listening...')
audio2 = r.listen(source2)
try:
os.system('cls||clear')
print('Recognizing...')
MyText = r.recognize_google(audio2)
MyText = MyText.lower()
print('You: '+MyText)
os.system('cls||clear')
except:
return(MyText)
def indices(a,c):
[21]
for i in range(len(a)):
if(a[i]==c):
ans=i
break
else:
ans=-1
return(ans)
def openwebsite(query):
Query=query.split()
x=indices(Query,'open')
website=Query[x+1]
webbrowser.open('https://'+str(website)+'.com')
def printspeak(s):
print('Bot: '+s)
speak(s)
query=takeCommand().lower()
print(query)
if('wikipedia' in query):
printspeak('Searching Wikipedia...')
query=query.replace("wikipedia","")
results=wikipedia.summary(query, sentences=3)
[22]
os.system('cls||clear')
printspeak(wishMe())
printspeak('Hello!')
elif(("What's up" in query) or ('how are you' in query) or ('how is it going' in query) or
('hows it going' in query)):
printspeak('Good to know!')
elif(('who are you' in query) or('what is your identity' in query) or ('introduce yourself'
in query)):
printspeak('I am JARVIS')
printspeak('Your welcome.')
[23]
printspeak('Ofcourse! In fact, turtle is my favourite pet.')
printspeak('I like singing, painting, playing the voilen, and clicking pictures of the
food i cook. Lol. and being a machine, there is nothing I dislike.')
elif('open' in query):
openwebsite(query)
elif('play' in query):
query=query.split('play')
printspeak('Searching youtube...')
pywhatkit.playonyt(query[1])
elif(('date' in query) and (("what's" in query) or ("what is" in query) or ("tell" in query)
or ('say' in query))):
current_time = datetime.datetime.now()
date=str(current_time)[:10]
elif(('time' in query) and (("what's" in query) or ("what is" in query) or ("tell" in query)
or ('say' in query))):
current_time = datetime.datetime.now()
time=str(current_time)[11:]
hour=time[:2]
m=' a.m.'
if(int(hour)>=13 or int(hour)<24):
[24]
m=' p.m.'
hour=str(int(hour)-12)
minute=time[3:5]
time=hour+':'+minute+m
else:
webbrowser.open('https://google.com?#q='+str(query))
try:
query=query.replace("wikipedia","")
results=wikipedia.summary(query, sentences=3)
if(query in results):
else:
except:
clear')
os.system('cls||clear')
[25]
4. PERFORMANCE ANALYSIS
Fig. 4.1
Fig. 4.2
[26]
Fig. 4.3
As we can see, it responded with an answer that makes sense!
[27]
4.2 It can play music and videos on Youtube.
Fig. 4.4
Fig. 4.5
[28]
Fig. 4.6
Fig. 4.7
[29]
4.3 It can do Wikipedia looks for you.
Fig. 4.8
Fig. 4.9
[30]
4.4 It is equipped for opening sites like Google, Youtube, and so forth,
on Chrome.
Fig. 4.10
Fig. 4.11
[31]
Fig. 4.12
Fig. 4.13
[32]
Fig. 4.14
Fig. 4.15
[33]
5. CONCLUSIONS
5.1 Conclusions
Through this voice assistant, we have automated various services using a single
line command. It eases most of the tasks of the user like searching the web,
retrieving weather forecast details, vocabulary help and medical related queries.
We aim to make this project a complete server assistant and make it smart
enough to act as a replacement for a general server administration. The future
plans include integrating Jarvis with mobile using React Native to provide a
synchronised experience between the two connected devices. Further, in the long
run, Jarvis is planned to feature auto deployment supporting elastic beanstalk,
backup files, and all operations which a general Server Administrator does. The
functionality would be seamless enough to replace the Server Administrator with
Jarvis.
[34]
● Chromium-based browser, like Chrome, Edge
● Node JS with npm Non-Functional Requirements:
[35]
REFERENCES: www.youtube.com
codewithharry.com
kaggle
towardsdatascience.com
[36]