0% found this document useful (0 votes)
8 views

Minor Project

The Minor Project Report details the development of 'Jarvis-Virtual Assistant' by a group of students at Maulana Azad National Urdu University, aimed at fulfilling the requirements for a Diploma in Computer Science and Engineering. The project utilizes Python and various libraries to create a voice assistant capable of performing tasks such as playing music, opening applications, and providing information through speech recognition. The report includes acknowledgments, a declaration, and an overview of the project's objectives, functionalities, and technical specifications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Minor Project

The Minor Project Report details the development of 'Jarvis-Virtual Assistant' by a group of students at Maulana Azad National Urdu University, aimed at fulfilling the requirements for a Diploma in Computer Science and Engineering. The project utilizes Python and various libraries to create a voice assistant capable of performing tasks such as playing music, opening applications, and providing information through speech recognition. The report includes acknowledgments, a declaration, and an overview of the project's objectives, functionalities, and technical specifications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

MINOR PROJECT REPORT

202
2022-2025
APRIL 23, 2024

MINOR PROJECT REPORT

JARVIS

Submitted to

Maulana Azad National Urdu University, Polytechnic


Darbhanga
For
Partial fulfilment of the Award of
Diploma in Computer Science and Engineering

Page | 2
Submitted By
Name Roll No
1.MD INTEKHAB ALAM KHAN 22DPCS002DB
2.ABUL HAYAT 22DPCS003DB
3.HASNAT MUSTAFA 22DPCS004DB
4.MD AMAAN AHMAD 22DPCS007DB
5.MD ANAS FAIYAZ 22DPCS011DB
6.MD IMRAN 22DPCS012DB

Submitted to

DR. ANJAIAH ADEPU


PRINCIPLE OF MANUU POLITECHNIC DARBHANGA

MAULANA AZAD NATIONAL URDU UNIVERSITY


POLYTECHNIC, DARBHANGA (BIHAR)
2022-2025

Page | 3
DECLARATION

We hereby declare that the Minor Project Report entitled ‘‘Jarvis-Virtual-


Assistant” is an authentic record of our work as requirement of Major Project
during the period from January-2024 to March-2024 for the award of degree of
Diploma in Computer Science and Engineering from Maulana Azad National
Urdu University (MANUU), Polytechnic, under the guidance of
DR. ANJAIAH ADEPU Assistant Professor, MANUU Polytechnic,
Darbhanga.

Signature of student
MD INTEKHAB ALAM KHAN___________
ABUL HAYAT_______________
HASNAT MUSTAFA_______________
MDAMAAN AHMAD_________________
MD ANAS FAIYAZ________________
MD IMRAN______________________

Date: - _____________

Page | 4
CERTIFICATE

Certified that this Project/training report entitled “JARVISH VIRTUAL


ASSISTANT” submitted by Group submission Maulana Azad National Urdu
University, Polytechnic, Darbhanga in the partial fulfillment of the requirement

for the award degree of Diploma in Computer Science and Engineering who
carried out the Major Project work under my supervision.

This report has not been submitted to any other university or institution for the
award of any degree.

Signature Signature of Supervisor


Dr. Anjaiah Adepu principle Of Manuu Polytechnic

( Darbhanga)

Computer Science & Engineering Computer Science & Engineering

MANUU Polytechnic Darbhanga MANUU Polytechnic Darbhanga

Page | 5
ACKNOWLEDGEMENT

At every outset, we express our gratitude to almighty lord for showering his
grace and blessings upon me to complete this Minor Project.

Although our name appears on the cover of this book, many people had
contributed in some or the other form. We could not have done this project
without the assistance or support of each of the following and we thank you all
for the same.

We wish to place on our record our deep sense of gratitude to Dr. Anjaiah
Adepu Principal of MANUU Polytechnic, Darbhanga, for his constant
motivation and valuable help through the Training.

We are very thankful to our Internal Guide DR. ANJIAH ADEPU Principle of
Manuu polytechnic Darbhanga, for co-operation and guidance given by him to
complete the project successfully.

We also express our gratitude to Faculty of computer Science Engineering,


MANUU Polytechnic Darbhanga for their valuable suggestions and advices
throughout the Diploma course.

We office our sincere thanks to Head of Computer Science Engineering


Department of Polytechnic Maulana Azad National Urdu University,
Darbhanga for giving us this opportunity to carry out this project work and for
his concern and encouragement.

We also express our thanks to non-teaching staff members who continuously


help as who fulfilling our Major project especially, we also went to thank to
non-teaching staff members.

Page | 6
PREFACE

Diploma Engineers are highly competent with their technical skills, but they
lack they practical exposure, managing skills, attitude and interpersonal skills,
when they first step into the industry this is very common phrase within the
industry.

The primary objective of Major project program is to overcome such problems


faced by a Diploma Engineer, and to build up a sound appreciation and
understanding of the theoretical principles learn as an undergraduate, by
exposing them to the industrial environment while being an undergraduate. It is
oriented toward developing the skills, knowledge and attitudes needed to make
an effective start as a member of the Engineering profession. This report parents
a brief presentation on gained, technical know-how, experiences, customer
interaction, challenges, achievements and failures during my Major
Project.
ABSTRACT

As we know python is an emerging language so it becomes easy to write a script for Voice Assistant
in Python. The instructions for the assistant can be handled as per the requirement of user. Speech
recognition is the process of converting speech into text. This is commonly used in voice assistants
like Alexa, Siri, etc. In Python there is an API called Speech Recognition which allows us to convert
speech into text. It was an interesting task to make my own assistant. It became easier to send
emails without typing any word, Searching on Google without opening the browser, and
performing many other daily tasks like playing music, opening your favorite IDE with the help of a
single voice command. In the current scenario, advancement in technologies are such that
they can perform any task with same effectiveness or can say more effectively than us. By making
this project, I realized there the concept of AI in every field decreasing human effort and saving time.

Functionality of this project include

1.It can play music

2.IT can open web Browser

3.It can open youtube

4.It can read pdf

Page | 7
5.it helps us to work with good manner

6. It can read book

7.It can acess the current date and time

8. It can tell the weather outside

9. It can open camera

10. It can compose and read email

LIST OF CONTENT
TOPIC PAGE
INTRODUCTION

CHAPTER 1:-VIRTUAL ASSISTANT&AI

CHAPTER 2:-HARDWARE/SOFTWARE
REQUIRMENT

CHAPTER 3:-JARVIS SOURCE CODE EXPLANATION

CHAPTER 4:-WORKING OF JARVIS

CHAPTER 5:-DATA FLOW DIAGRAM

CHAPTER6:-FUTURE PROSPECTIVE

Page | 8
INTRODUCTION
Have you ever wondered how cool it would be to have your own
voice assistant?.Imagine how easier it would be to send emails
without typing a single word, do Wikipedia searches without
opening web browsers, and performing many other daily tasks
like playing music with the help of a single voice command. In this
tutorial, I will teach you how you can make your personal A.I.
assistant using Python.

WHAT CAN THIS VOICE ASSISTANT CAN DO


 It can play music for you.
 It can do Wikipedia searches for you.
 It is capable of opening websites like Google, YouTube, etc., in a
web browser.
 It can open the camera from your phone
 It can crack a jokes
 It can tell the weather outside
 It can open Netflix, Spotify, Prime Videos
 It can read books

Page | 9
CHAPTER 1
:- Virtual Assistant and AI

A virtual assistant, also called an AI assistant or digital assistant, is an


application program that understands natural language voice
commands and completes tasks for the user. Such tasks, historically
performed by a personal assistant or secretary, include taking
dictation, reading text or email messages aloud, looking up phone
numbers, scheduling, placing phone calls, and reminding the end
user about appointments. Popular virtual assistants currently include
Amazon Alexa, Apple's Siri, Google Assistant, and Microsoft's Cortana
-- the digital assistant built into Windows.
TYPES OF ASSISTANT
Though this definition focuses on the digital form of virtual
assistants, the term virtual assistant, or virtual personal assistant, is
also commonly used to describe contract workers who work from
home doing administrative tasks typically performed by executive
assistants or secretaries. Virtual assistants can also be contrasted
with another type of consumer-facing AI programming ,called smart
advisers. Smart adviser programs are subject-oriented,while virtual
assistants are task-oriented.

Page | 10
Devices and technology
Virtual assistants are typically cloud-based programs that require
internet-connected devices and/or applications to work. Three such
applications are Siri on Apple devices, Cortana on Microsoft
Devices and Google Assistant on Android devices. There are also
devices dedicated to providing virtual assistance. The most popular
ones are available from Amazon, Google and Microsoft. To use the
Amazon Echo virtual assistant, called Alexa, users call out the
wake word, "Alexa." Alight on the device signals to the user it is
ready to receive a command, which typically involves simple
language requests, such as "what is the weather today," or" play
pop music." Those requests are processed and stored in
Amazon's cloud. The technologies that power virtual assistants
require massive amounts of data, which feeds artificial
intelligence(AI) platforms, including machine learning, natural
language processing and speech recognition platforms. As the end
user interacts with a virtual assistant, the AI programming uses
sophisticated algorithms to learn from data input and become better
at predicting the end user's needs.

Page | 11
Virtual assistant capability
Virtual assistant capabilities Virtual assistants typically perform
simple jobs for end users, such as adding tasks to a calendar;
providing information that would normally be searched in a web
browser; or controlling and checking the status of smart home
devices, including lights, cameras and thermostats .Users also task
virtual assistants to make and receive phone calls, create text
messages, get directions, hear news and weather reports, find hotels
or restaurants, check flight reservations, hear music, or play games

NOTE :-
VIRTUAL ASSISTANT IN FUTURE ALSO REPLACE HUMAM
BRAIN AND EVEN DISCOVER MANY UNSOLVED MYSTERY

ARTIFICIAL INTELEGENCE
ARTIFICIAL INTELEGENCE Artificial intelligence (AI) refers to the
simulation of human intelligence in machines that are
programmed to think like humans and mimic their actions. The
term may also be applied to any machine that exhibits traits
Page | 12
associated with a human mind such as learning and problem
solving.

The idea characteristic of artificial intelligence is its ability to


rationalize and take actions that have the best chance of
achieving a specific goal. As ubset of artificial intelligence is
machine learning , which refers to the concept that computer
programs can automatically learn from and adapt to new data
without being assisted by humans. Deep learning techniques enable
this automatic learning through the absorption of huge amounts of
unstructured data such as text, images, or video.

Understanding
standing Artificial Intelligence (AI)
When most people hear the term artificial intelligence, the first
thing they usually think of is robots. That's because bigbig-budget
films and novels weave stories about human-like like machines that
wreak havoc on Earth. But nothing could be further from truth.
Artificial intelligence is based on the principle that human
intelligence can be defined in a way that a machine can easily mimic
Page | 13
it and execute tasks, from the most simple to those that are even
more complex. The goals of artificial intelligence include
mimicking human cognitive activity. Researchers and developers
in the field are making surprisingly rapid strides in mimicking
activities such as learning, reasoning, and perception, to the extent
that these can be concretely defined. Some believe that
innovators may soon be able to develop systems that exceed the
capacity of humans to learn or reason out any subject. But others
remain skeptical because all cognitive activity is laced with value
judgments that are subject to human experience. As technology
advances, previous benchmarks that defined artificial intelligence
become outdated. For example, machines that calculate basic
functions or recognize text through optical character recognition are
no longer considered to embody artificial intelligence, since this
function is now taken for granted as an inherent computer
function.AI is continuously evolving to benefit many different
industries. Machines are wired using a cross-disciplinary approach
based on mathematics, computer science, linguistics, psychology, and
more. Algorithms often play a very important part in the structure of artificial intelligence,
where simple algorithms are used in simple applications, while more complex ones help frame
strong artificial intelligence.

Applications of Artificial Intelligence


The applications for artificial intelligence are endless. The technology
can be applied to many different sectors and industries. AI is being
tested and used in the health care industry for dosing drugs and
different treatment in patients, and for surgical procedures in the
operating room. Other examples of machines with artificial
intelligence include computers that play chess and self-driving cars.
Each of these machines must weigh the consequences of any action
they take, as each action will impact the end result. In chess, the end
result is winning the game. For self-driving cars, the computer
system must account for all external data and compute it to act in a
way that prevents a collision. Artificial intelligence also has
Page | 14
applications in the financial industry
industry, where it is used to detect and
flag activity in banking and finance such as unusual debit card
usage and large account deposits
deposits—all of which help a bank's fraud
department. Applications for AI are also being used to help stream
line and make trading easier. This is done by making supply, demand,

Page | 15
CHAPTER 2 :-
Software and Hardware specification.
 Hardware requirements

Processor : Intel i5

Processor speed : 2.5 GHZ

RAM : 8 GB

SSD : 512 GB

 Software Requirement

IDE :-
VISUAL STUDIO CODE & PyCharm are the most popular IDE for
Python and includes great features such as excellent code
completion and inspection with advanced debugger and support for
web programming and various frameworks. PyCharm is created by
Czech company, Jet brains which focusses on creating integrated
development environment for various web development languages
like JavaScript and PHP. Language: PYTHON 3.11

Library:-

Pyttsx: -
Pyttsx3 stands for Python Text to Speech. It is a cross-platform
Python wrapper for text-to-speech synthesis.

Page | 16
It is a Python package supporting common text-to-speech engines on
Mac OS X. Windows, and Linux. It works for both Python2.x and 3.x
versions. Its main advantage is that it works offline.

Speech Recognition:-
This is a library for performing speech recognition, with support for
several engines and APIs, online and offline

It supports APIs like Google Cloud Speech API, IBM Speech to Text,
Microsoft Bing. Voice Recognition etc.

PyWhatKit: -
is a Python library with various helpful features. It's easy to use and
does not require you to do any additional setup. Currently, it is one of
the most popular libraries for WhatsApp and YouTube automation.
New updates are released frequently with new features and bug
fixes.

Requests:-
library is of an integral parts Python for making HTTP requests to a
specified URL. Whether it be REST APIs or Web Scrapping, requests is
a must be learned for proceeding further with these technologies.
When one makes a request to a URI, it returns a response. Python
requests provide inbuilt functionalities for managing both the
request and response.

Page | 17
Beautiful Soup:-
a Python library for pulling data out of HTML and XML files. It works
with your favorite parser to provide idiomatic ways of navigating,
searching, and modifying the parse tree. It commonly saves
programmers hours or days of work.

Time:-
Python's time module provides a function for getting local time from
the number of seconds elapsed since the epoch called local time().
Notice that tm_isdst=0. Since DST matters with local time, timeis

Page | 18
CHAPTER 3 :-

JARVIS SOURCE CODE AND EXPLANATION


Defining Speak Function
A.I. assistant is that it should be able to speak. To make our J.A.R.V.I.S.
talk, we will make This function will take audio as an argument, and
then it will pronounce it.
def speak(audio): pass
Now, the next thing we need is audio. We must supply audio so that
we can pronounce it using the speak() function we made. We are
going to install a module called pyttsx3.
What is pyttsx3?
A python library that will help us to convert text to speech. In short, it
is a text-to-speech library. It works offline
Installation:-
In case you receive such errors:
* No module named win32com.client
* No module named win32
* No module named win32api
* Then, install pypiwin32 by typing the below command in the
terminal:
* After successfully installing pyttsx3, import this module into your
program.

Page | 19
 Microsoft developed speech APL
 Helps in synthesis and recognition
of voice.
What Is Voiceld?
 Voice id helps us to select different
voices.
1. voice[0].id David voice
2. voice[1].id Zira voice

functions()
speak ()

Wishme()

Now, we wish awake ke a wishme() function, that will make our


J.A.R.V.I.S. wish or greet the user according tto
o the time of the
computer or PC.. To provide current or live time to A.I.,
A.I., we need to
import a module DateTimetime
DateTimetime.. Import this module to your
program.
Page | 20
SPEECH RECOGNITION()

Lets start coding the take command function()


We have successfully created our take Command() function. And we
add a try and except block to our program to handle errors
effectively.

SEARCH ON WIKIPEDIA( )

To do Wikipedia searches, we need to install and import the


Wikipedia module into our program. Type the below command to
install the Wikipedia module:
Page | 21
OPEN YOUTUBE ( )
To open any website, we need to import a module called web
browser. It is an in-built
built module, and we do not need to install it with
a pip statement; we can di directly
rectly import it into our program by writing
an import statement.

Code:

SEARCH ON GOOGLE( )
We are opening Google in a web
web-browser by applying the same logic
that we used to open YouTube.

PLAY MUSIC( )
To play music, we need to import a module called os. Import this
module directly with an import statement.

Page | 22
CURRENT DATE & TIME ( )

In the above, code with using datetime() function and storing the
current or live system into a variable called str Time. After storing the
time in str Time, we are passing this variable as an argument in speak
function. Now, the time string will be converted into speech.

SEND EMAIL( )

What is smtplib?

Simple Mail Transfer Protocol (SMTP) is a protocol that allows us to


send emails and to route emails between mail servers. An instance
method called send mall is present in the SMTP module.

Page | 23
This instance method allows us to send an email. It tak
takes 3
parameters:
The sender: Email address of the sender.
The receiver: Email of the receiver The message: A string message
which needs to be sent to one or
more than one recipient.
DEFINING Server. Send mail ("vouramailingmail.com, to, content)

PYJOKE ( )

PYJOKE IS INBUILTBT PYTHON LIBRARY WHICH IS USED FOR USINNG


RANDOM JOKES

TEMPRATURE( )
since you have to purchase weather API for using weather function
.we have used an alternative method we have used request module
to take information from www.google.com and beautifulsoup for
extracting that information and speaking current temorature.

Page | 24
CURRENT LOCATION ON GOOGLE MAP( )

Page | 25
CHAPTER 4
WORKING OF JARVIS
import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import webbrowser as wb
import os
import pyautogui
import webbrowser
import pywhatkit
import pyjokes
from playsound import playsound

engine = pyttsx3.init()

def speak(audio):
engine.say(audio)
engine.runAndWait()

def wishme():
hour = datetime.datetime.now().hour
if 4 <= hour < 12:
greet = "Good Morning Sir!!"
elif 12 <= hour < 16:
greet = "Good Afternoon Sir!!"
elif 16 <= hour < 24:
greet = "Good Evening Sir!!"
else:
greet = "Good Night Sir, See You Tomorrow"

welcome_message = f"Welcome back sir!! {greet} Jarvis


at your service sir, please tell me how may I help you."
speak and print(welcome_message)
Page | 26
speak(welcome_message)

def screenshot():
img = pyautogui.screenshot()
user_directory =
os.path.expanduser("~\\Pictures\\ss.png")
img.save(user_directory)

def google_search(query):
search_url = "https://www.google.com/search?q=" +
"+".join(query.split())
wb.open(search_url)

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-
in")
print(query)

except Exception as e:
print(e)
speak("Please say that again")
return "Try Again"

return query

if __name__ == "__main__":
wishme()
while True:
Page | 27
query = takecommand().lower()

if "what is time now" in query:


time_now =
datetime.datetime.now().strftime("%I:%M:%S")
speak and print(f"The current time is
{time_now}")
speak(time_now)

elif "date" in query:


current_date =
datetime.datetime.now().strftime("%d/%m/%Y")
speak and print(f"The current date is
{current_date}")
speak(current_date)

elif "who are you" in query:


speak("I'm JARVIS created by Amaan and I'm a
desktop voice assistant.")
print("I'm JARVIS created by Amaan and I'm a
desktop voice assistant.")

elif "how are you" in query:


speak("I'm fine sir, What about you?")
print("I'm fine sir, What about you?")

elif "fine" in query:


speak("Glad to hear that sir!!")
print("Glad to hear that sir!!")

elif "good" in query:


speak("Glad to hear that sir!!")
print("Glad to hear that sir!!")

elif "wikipedia" in query:


try:

Page | 28
speak("Ok wait sir, I'm searching...")
query = query.replace("wikipedia","")
result = wikipedia.summary(query,
sentences=2)
print(result)
speak(result)
except:
speak("Can't find this page sir, please
ask something else")

elif "open youtube" in query:


speak("what should i search in youtube")
query= takecommand().lower()
pywhatkit.playonyt(query)
webbrowser.open("https://www.youtube.com/")

elif "search on google" in query:


speak("What should I search on Google?")
search_query = takecommand()
google_search(search_query)

elif "open stack overflow" in query:


wb.open("stackoverflow.com")

elif "remember that" in query:


speak("What should I remember")
data = takecommand()
speak("You said me to remember that" + data)
print("You said me to remember that " +
str(data))
remember = open("data.txt", "w")
remember.write(data)
remember.close()

elif "do you remember anything" in query:

Page | 29
remember = open("README.txt", "r")
speak("You told me to remember that" +
remember.read())
print("You told me to remember that " +
str(remember))

elif "screenshot" in query:


screenshot()
speak("I've taken screenshot, please check
it")

elif "open stack overflow" in query:


wb.open("stackoverflow.com")

elif "joke" in query:


joke=pyjokes.get_joke()
print(joke)
speak(joke)

elif "offline" in query:


quit()

else:
speak("I'm sorry, I didn't understand that
command.")

Page | 30
Page | 31

You might also like