0% found this document useful (0 votes)
51 views41 pages

Blackb

Uploaded by

Sneha Gaikwad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views41 pages

Blackb

Uploaded by

Sneha Gaikwad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 41

A

Project
Report On

Voice Assistant Using Python

Submitted in partial fulfillment of the requirements of the diploma


in

Computer Engineering

Submitted by

Ms. Sneha Dadaso Gaikwad 2111480043

Ms.Shreya Puroshattom Phule 2211480171

Supervisor
Mr. Sajid Shaikh
Department of Computer Engineering
Mahatma Education Society’s
Pillai HOC College of Engineering and Technology, Rasayani
(Diploma Section-1148)
Tal: Khalapur, Dist.: Raigad, PIN Code:410207
Academic Year 2023 – 2024
Mahatma Education Society

Pillai HOC College of Engineering and Technology (Diploma


section),
Rasayani, Tal: Khalapur,
Dist.: Raigad-410207
Department of Computer Engineering
Date: / /

CERTIFICATE

This is to certify that Mr. Sneha Dadaso Gaikwad from Pillai HOC College
of Engineering and Technology Diploma section (1148) Institute having
Enrollment No. 2111480043 has completed the first phase of the final year
project titled “Voice Assistant Using Python” during the academic year 2023-
2024. The project was completed by a group consisting of 2 Candidates under
the guidance of Mr. Sajid Shaikh.

Name & Signature of Guide…………………………………………………………

Name & Signature of HOD………………………………………………………….

Name & Signature of


Principal………………………………………………
Mahatma Education Society

Pillai HOC College of Engineering and Technology (Diploma


section),
Rasayani, Tal: Khalapur,
Dist.: Raigad-410207
Department of Computer Engineering
Date: / /

CERTIFICATE

This is to certify that Mrs. Shreya Puroshattom Phule from Pillai HOC
College of Engineering and Technology Diploma section (1148) Institute
having Enrollment No. 2211480171 has completed the first phase of the final
year project titled “Voice Assistant Using Python ” during the academic year
2023-2024. The project was completed by a group consisting of 2 Candidates
under the guidance of Mr. Sajid Shaikh

Name & Signature of Guide…………………………………………………………

Name & Signature of HOD………………………………………………………….

Name & Signature of Principal……………………………………………………...


DECLARATION

We declare that this written submission represents our ideas in our own words and where
other's ideas or words have been included, we adequately cite and reference the original
sources. we also declare that we have adhered to all principles of academic honesty and
integrity and have not misrepresented or fabricated or falsified any idea/data/fact/source in
our submission. we understand that any violation of the above will be cause for disciplinary
action by the Institute and can also evoke penal action from the sources which have thus not
been properly cited or from whom proper permission has not been taken when needed.

Sneha Dadaso Gaikwad

Shreya Puroshattom

Phule

(Signatures)

Date:
Index

ACKNOWLEDGEMENT...............................................................................i
ABSTRACT......................................................................................................ii

Chapter no. TITLE Page No.

1 INTRODUCTION.................................................................................1

1.1. DESIGN.........................................................................................3
1.2. VOICE ASSISTANT.....................................................................3
1.3.1 WHAT IS VOICE ASSISTANT................................................3
1.3.2 WHY DO WE NEED IT.............................................................3
1.3.3 WHERE TO USE IT...................................................................3

2 LITERATURE SURVEY...............................................................4

2.1. RELATED WORK.......................................................................5

3 METHODOLOGIES........................................................................8

3.1. EXISTING SYSTEM....................................................................9


3.2. PROPOSED SYSTEM..................................................................9
3.3. OBJECTIVE OF THE PROJECT.................................................10
3.4. SOFTWARE AND HARDWARE REQUIREMENTS................11
3.4.1. SOFTWARE REQUIREMENTS..............................................11
3.4.2. HARDWARE REQUIREMENTS.............................................11
3.5. PROGRAMMING LANGUAGES..............................................13
3.5.1. PYTHON....................................................................................13
3.5.2. DOMAIN....................................................................................14
FLOWCHART...............................................................................15

4 RESULTS AND DISCUSSION.......................................................16


4.1. WORKING.....................................................................................17

5 CONCLUSION....................................................................................20
REFERENCES...................................................................................23
APPENDICES.....................................................................................24
A. SOURCE CODE.............................................................................24
B. SCREENSHOT...............................................................................30
Voice Assistant using
Python
ACKNOWLEDGEMENT

We would like to take this opportunity to thank one and all that provided their valuable
advice and guidance without which this seminar would not have been completed. We
thank all who have helped me directly or indirectly but some in particular have to be
singled out since they have given me more than just guidance.
We wish to express our deep respect and thankfulness to Mr. Sajid Shaikh , our
project guide. Without his guidance, insightful comments, smart encouragement and
valuable help this work would not have been a success.
We have great pleasure in acknowledging the help we received from all those who
favoured in giving shape to this project, a sincere thanks to all the samples who filled
out our questionnaires.
The Smart people out there who invented the Internet and Google. And obviously our
great teachers.

Computer Engineering

Pillai HOC College of Engineering and i


Technology i
Voice assistant using
python
ABSTRACT

A Voice Assistant is one of the hot topics in the current world that are programs that listens to
human’s verbal command and respond to them which makes it a human computer/device
interaction. In the current days, a voice assistant is everywhere which is a lot useful in these
busy days. Nowadays, almost everyone in the current world is using voice assistant because
it’s everywhere starting from Google smartphone assistant which even 5 years old kids will
know how to use because of the current world pandemic which makes them use smartphones
till Amazon's Alexa which will be very useful to do works starting from entertaining the users
till turning on and off the household products (Internet of Things). One of the greatest
features is that it will be very useful to even physically challenged people, for example,
people who aren't able to walk use the Internet of Things (IoT) feature to operate the
household products and maintain them. So, we tend to develop a voice assistant which will be
very useful to the users same as the other voice assistants which are currently in the world.

Pillai HOC College of Engineering and i


Technology
Voice Assistant using Python

CHAPTER NO:1
INTRODUCTION

Pillai HOC College of Engineering and Technology [Diploma Page 1


Section]
Voice Assistant using Python

CHAPTER:1

INTRODUCTION

The very first voice activated product was released in 1922 as Radio Rex. This toy was very simple,
wherein a toy dog would stay inside a dog house until the user exclaimed its name, “Rex” at which point
it would jump out of the house. This was all done by an electromagnet tuned to the frequency similar to
the vowel found in the word Rex, and predated modern computers by over 20 years. In the 21st century,
human interaction is being replaced by automation very quickly. One of the main reasons for this change
is performance. There’s a drastic change in technology rather than advancement. In today’s world, we
train our machines to do their tasks by themselves or to think like humans using technologies like
Machine Learning, Neural Networks, etc. Now in the current era, we can talk to our machines with the
help of virtual assistants. Virtual assistants are software programs that help you ease your day to day
tasks, such as showing weather reports, giving daily news, searching the internet etc. They can take
commands by voice. Voice-based intelligent assistants need an invoking word or wake word to activate
the listener, followed by the command. We have so many virtual assistants, such as Apple’s Siri,
Amazon’s Alexa and Microsoft’s Cortana and Amazon's Alexa and this has been an inspiration for us to
do this as a project. This system is designed to be used efficiently on desktops. Voice assistants are
programs on digital devices that listen and respond to verbal commands. A user can say, “What's the
weather?” and the voice assistant will answer with the weather report for that day and location.
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. Voice based personal
assistants have gained a lot of popularity in this era of smart homes and smart devices. These personal
assistants can be easily configured to perform many of your regular tasks by simply giving voice
commands. Google has popularized voice-based search that is a boon for many like senior citizens.

Pillai HOC College of Engineering and Technology [Diploma Section] Page 2


Voice Assistant using Python

1.1 DESIGN
a) The voice assistant takes an input word which is called as "signal word" to be activated. so, it takes in
the signal word and starts operating for the user commands. b) Converting the speech into text will be
processed by the assistant. c) The converted text is now processed to get the required results. d) The text
given by the user should contain one or two keywords that determine what query is to be executed. If
the keyword doesn’t match any of the queries in the code then the assistant asks the user to speak again.
e) Finally, the output to the user's query will be given by converting speech to text.

1.2VOICE ASSISTANT
Our assistant “Jarvis” extends to helps us when working on a system in which it is installed. We can
access by calling the wake word "Hello Jarvis".
1.3.1 WHAT IS VOICE ASSISTANT A voice assistant, also known as an intelligent personal assistant
or a connected speaker, is a new type of device that is based on natural language speech recognition and
is offered by popular companies like Apple, Amazon, and Google. We got inspired by that and created
one our self.
1.3.2 WHY DO WE NEED IT usually, typing out and searching or doing day-to-day tasks becomes
hectic. But our life doesn’t need to be like that. One can ask for help to voice assistants. They let the
users to perform a task using a speech command, as well as retrieve information via voice synthesis.

Pillai HOC College of Engineering and Technology [Diploma Page 3


Section]
Voice Assistant using Python

CHAPTER NO:2
LITREATURE SURVEY

Pillai HOC College of Engineering and Technology [Diploma Page 4


Section]
Voice Assistant using Python

CHAPTER 2

LITERATURE SURVEY

2.1 RELATED WORK This field of virtual assistants having speech recognition has seen some major
advancements or innovations. This is mainly because of its demand in devices like smart watches or
fitness bands, speakers, Bluetooth earphones, mobile phones, laptop or desktop, television, etc. Almost
all the digital devices which are coming nowadays are coming with voice assistants which help to
control the device with speech recognition only. A new set of techniques is being developed constantly
to improve the performance of voice automated search. As the amount of data is increasing
exponentially now known as Big Data the best way to improve the results of virtual assistants is to
incorporate our assistants with machine learning and train our devices according to their uses. Other
major techniques that are equally important are Artificial Intelligence, Internet of Things, Big Data
access and management, etc. With the use of voice assistants, we can automate the task easily, just give
the input to the machine in the speech form and all the tasks will be done by it from converting your
speech into text form to taking out keywords from that text and execute the query to give results to the
user. Machine Learning is just a subset of Artificial Intelligence. This has been one of the most helpful
advancements in technology. Before AI we were the ones who were upgrading technology to do a task
but now the machine is itself able to counter new tasks and solve it without need to involve the humans
to evolve it. This has been helpful in day-to-day lifestyle. From mobile phones to personal desktops to
mechanical industries these assistants are in very much demand for automating tasks and increasing
efficiency.
2.2 Some Reasons why there is necessity of voice assistants: There are lots of reason why this verbal voice
command application is in need in real time situations. Some of them are given below.
To enable a highly engaging user experience: Voice assistance engages users like no other interface.
Users can speak to the applications naturally to ask for whatever they'd like. To make application
frustration free: We have to touch, type and mouse in the existing machine system to getting our work
done, which are makes user frustrated sometimes. By using voice assistant users can directly ask what
they wanted to get done. To personalize your app experience for every user: Voice assistants are actually
able to respond for every user based on their locality, language and preferences.
Basics fundamental tasks performed by Voice assistants are as follows:
• Search on web
• Play a music or video

Pillai HOC College of Engineering and Technology [Diploma Section ] Page 5


Voice Assistant using Python

• Setting a reminder and alarm


• Run any program or application
• Getting weather updates
Sending WhatsApp, email messages etc. These are very few examples of tasks performed by voice
assistants; we can do many more things according to our requirement. The capabilities and
improvements of voice assistants are continuously developing day by day to provide better performance
to users. We have used python modules and libraries for making our Desktop based voice assistant so
that our personal voice assistant can run easily, smoothly on desktop.
The basic idea of our Project is that the user makes a request to voice assistant through the Microphone of
the device to get their work done and then their command gets converted into text. Then the text request
goes to processing gives text response along with work done by voice assistant. Along with basic day to
day functionalities we are also trying to implement the concept of Face detection for security purpose in
our voice assistant to make it more flexible and to it make it more personal. our program uses the least
amount of system resources which minimizes the expensive system requirements also reduces threat to
your system as it directly does not interact with servers.
In today’s world we train our machine to think like humans and do their task by themselves and what
human being can do is being replaced by machines. Based on this situation there comes concept of voice
assistant capable of completing various task for the humans based on their voice. Specific commands
given by the user to virtual assistant is capable of filtering out the command and return relevant
information [1]. People in the whole world are transforming their digital experience using upcoming
technologies like virtual reality, augmented reality, voice interaction etc. Voice control is emerging as
new evolution in Human and Machine interaction where analog signal is converted by speech signal to
digital wave. In Last few years huge increase in the use of smart phones led to the great use of voice
assistant like Apple’s Siri, Google’s Assistant, Microsoft’s Cortana and Amazon’s Alexa etc. Voice
assistants are built using technologies like voice recognition, speech synthesis, and Natural Language
Processing (NLP) to provide indefinite applications to the users to make their life easy and comfortable.

Pillai HOC College of Engineering and Technology [Diploma Section ] Page 6


Voice Assistant using Python

CHAPTER NO:3
METHODOLOGY

Pillai HOC College of Engineering and Technology [Diploma Section ] Page 7


Voice Assistant using Python

CHAPTER 3
METHODOLOGY
3.1 EXISTING SYSTEM

From the above literature survey, we have inferred that all the systems existing predict only particular
diseases namely lung disease, breast cancer, heart disease, diabetes by implementing various algorithms
on the particular datasets. After implementing various algorithms, the most accurate one is selected and
it is used for prediction of disease. Sometimes, we may get confused of what algorithm to use. Also, all
the systems find only the particular disease and not the disease based on the symptoms.
3.2 PROPOSED SYSTEM

We are proposing a system in an efficient way of implementing a Personal voice assistant, Speech
Recognition library has many in-built functions, that will let the assistant understand the command
given by user and the response will be sent back to user in voice, with Text to Speech functions. When
assistant captures the voice command given by user, the under lying algorithms will convert the voice
into text and according to the keywords present in the text (command given by user), respective action
will be performed by the assistant. This is made possible with the functions present in different libraries.
Also, the assistant was able to achieve all the functionalities with help of some API’s. We had used
these APIs for functionalities like performing calculations, extracting news from web sources, and for
telling the weather. We will be sending a request, and through the API, we’re getting the respective
output. API’s like WOLFRAMALPHA, are very helpful in performing things like calculations, making
small web searches and for getting the data from web. In this way, we are able to extract news from the
web sources, and send them as input to a function for further purposes. Also, we have libraries like
Random and many other libraries, each corresponding to a different technology.

Pillai HOC College of Engineering and Technology [Diploma Page 9


Section]
Voice Assistant using Python

At the outset we make our program capable of using system voice with the help of sapi5 and pyttsx3.
pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and
is compatible with both Python 2 and 3. The Speech Application Programming Interface or SAPI is an
API developed by Microsoft to allow the use of speech recognition and speech synthesis within Windows
applications. Then we define the speak function to enable the program to speak the outputs. After that we
will define a function to take voice commands using the system microphone. The main function is then
defined where all the capabilities of the program are defined.

 The proposed system will have the following functionality:


(a) The system will keep listening for commands and the time for listening is variable which can be
changed according to user requirements.
(b) If the system is not able to gather information from the user input it will keep asking again to
repeat till the desired number of times.
(c) The system can have both male and female voices according to user requirements.
(d) Features supported in the current version include playing music, texts, search on Wikipedia, or
opening system installed applications, opening anything on the web browser, etc.

3.3 OBJECTIVE OF PROJECT

Main objective of building personal assistant software (a virtual assistant) is using semantic data sources
available on the web, user generated content and providing knowledge from knowledge databases. The
main purpose of an intelligent virtual assistant is to answer questions that users may have. This may be
done in a business environment, for example, on the business website, with a chat interface. On the
mobile platform, the intelligent virtual assistant is available as a call-button operated service where a
voice asks the user “What can I do for you?” and then responds to verbal input. Virtual assistants can
tremendously save you time. We spend hours in online research and then making the report in our terms
of understanding.

Pillai HOC College of Engineering and Technology [Diploma Section] Page 10


Voice Assistant using Python

3.4.1 SOFTWARE REQUIREMENTS

Software Requirements:
 Python 3.5 & Above
 Windows 7 And Above 3.4.2 Hardware Requirements:
 Processor: Intel Core i5
 RAM: 4GB
 OS: Windows / Mac
 Microphone
 ARDUINO UNO board
 Relay
 A Light Bulb
 USB Cable
 Electronics Wires
 Plug Point & a Plug

3.4.2 HARDWARE REQUIREMENTS

1. Microphone and Speaker

A microphone is the device that captures audio data from the user and sends it to the system for
processing. A speaker, on the other hand, plays the system's response back to the user. For a voice
assistant AI system, it is important to use a high-quality microphone and speaker to ensure clear and
accurate audio data.

When selecting a microphone and speaker for a voice assistant AI system, it is recommended to choose
a device that is compatible with the system and meets the minimum requirements for recording and
playing back audio data.

2. Memory

Memory, also known as RAM (Random Access Memory), is the temporary storage area used by the
system to store data and instructions. In a voice assistant AI system, memory plays a critical role in
storing audio and video data captured by the microphone and camera, as well as running the AI
algorithms and responding to user queries.

Pillai HOC College of Engineering and Technology [Diploma Page 11


Section]
Voice Assistant using Python

For a voice assistant AI system, it is recommended to use a system with at least 4 GB of RAM.
Additionally, the RAM should have a high clock speed, which can improve the performance of the
system.

3. Storage

Storage, also known as a hard drive or SSD (Solid State Drive), is the permanent storage area used by
the system to store data and files. In a voice assistant AI system, storage is used to store the operating
system, AI algorithms, and other files required for the system to function.

For a voice assistant AI system, it is recommended to use a system with at least 128 GB of storage.
Additionally, it is recommended to use an SSD instead of a hard drive, as SSDs offer faster read and
write speeds, which can improve the overall performance of the system.

4. Processor

The processor, also known as the CPU (Central Processing Unit), is the brain of the computer system. It
is responsible for executing instructions and performing calculations required by the system. In a voice
assistant AI system, the processor plays a critical role in processing audio and video data captured by
the microphone and camera, running the AI algorithms, and responding to user queries.

For a voice assistant AI system, it is recommended to use a high-performance processor with multiple
cores. The number of cores determines the number of tasks the processor can handle simultaneously. A
processor with more cores can handle more tasks simultaneously, which can improve the overall
performance of the system.

Additionally, the clock speed of the processor is also an important factor in the performance of the
system. A higher clock speed means that the processor can execute instructions more quickly, which can
lead to faster response times and better performance.

When selecting a processor for a voice assistant AI system, it is recommended to choose a high-
performance processor with at least 4 cores and a clock speed of at least 2.5 GHz.
Additionally, it is important to ensure that the processor is compatible with the motherboard and other
components of the system.

In conclusion, a high-quality microphone and speaker, sufficient memory and storage, and a high-
performance processor with multiple cores and a high clock speed are the key hardware requirements
for a voice assistant AI system. It is important to choose components that are compatible with each
other and meet the minimum requirements for running voice assistant AI and Python.

Pillai HOC College of Engineering and Technology [Diploma Page 12


Section]
Voice Assistant using Python

3.5. PROGRAMMING LANGUAGES

3.5.1 PYTHON
Python is an OOPs (Object Oriented Programming) based, high level, interpreted programming
language. It is a robust, highly useful language focused on rapid application development (RAD).
Python helps in easy writing and execution of codes. Python can implement the same logic with as
much as 1/5th code as compared to other OOPs languages. Python provides a huge list of benefits to all.
The usage of Python is such that it cannot be limited to only one activity. Its growing popularity has
allowed it to enter into some of the most popular and complex processes like Artificial Intelligence (AI),
Machine Learning (ML), natural language processing, data science etc. Python has a lot of libraries for
every need of this project. For this project, libraries used are speech recognition to recognize voice,
Pyttsx for text to speech, selenium for web automation etc. It’s owing to the subsequent strengths that
Python has –

 Easy to be told and perceive- The syntax of Python is simpler; thence it's comparatively
straightforward, even for beginners conjointly, to be told and perceive the language.
 Multi-purpose language − Python could be a multi-purpose programing language as a result of it
supports structured programming, object-oriented programming yet as practical programming.
 Support of open supply community − as being open supply programing language, Python is
supported by awfully giant developer community. Because of this, the bugs square measure simply
mounted by the Python community. This characteristic makes Python terribly strong and adaptive.

Pillai HOC College of Engineering and Technology [Diploma Page 13


Section]
Voice Assistant using Python

3.5.2 DOMAIN
The internet of things, or IoT, is a system of interrelated computing devices, mechanical and digital
machines, objects, animals or people that are provided with unique identifiers (UIDs) and the ability to
transfer data over a network without requiring human-to-human or human-to-computer interaction. A
thing in the internet of things can be a person with a heart monitor implant, a farm animal with a biochip
transponder, an automobile that has built in sensors to alert the driver when tire pressure is low or any
other natural or man-made object that can be assigned an Internet Protocol (IP) address and is able to
transfer data over a network. Increasingly, organizations in a variety of industries are using IoT to
operate more efficiently, better understand customers to deliver enhanced customer service, improve
decision-making and increase the value of the business. An IoT ecosystem consists of web-enabled
smart devices that use embedded systems, such as processors, sensors and communication hardware, to
collect, send and act on data they acquire from their environments. IoT devices share the sensor data
they collect by connecting to an IoT gateway or other edge device where data is either sent to the cloud
to be analyzed or analyses locally. Sometimes, these devices communicate with other related devices
and act on the information they get from one another. The devices do most of the work without human
intervention, although people can interact with the devices -- for instance, to set them up, give them
instructions or access the data.

Page 14
Pillai HOC College of Engineering and Technology [Diploma
Section]
Voice Assistant using Python

Flowchart

Page 15
Pillai HOC College of Engineering and Technology [Diploma
Section]
Voice Assistant using Python

CHAPTER NO:4
RESULT AND
DISCUSSION

Pillai HOC College of Engineering and Technology [Diploma Page 16


Section]
Voice Assistant using Python

Pillai HOC College of Engineering and Technology [Diploma Page 17


Section]
Voice Assistant using Python

CHAPTER 4

RESULTS AND DISCUSSION

The project work of the voice assistant has been clearly explained in this report, how useful it is and how
we can rely on a voice assistant for performing any/every task which the user needs to complete and how
the assistant is developing everyday which we can hope that it'll be one of the biggest technology in the
current technological world. Development of the software is almost completed form our side and it's
working fine as expected which was discussed for some extra development. So, maybe some
advancement might come in the near future where the assistant which we developed will be even more
useful than it is now.

4.1. WORKING

It starts with a signal word. Users say the names of their voice assistants for the same reason. They
might say, “Hey Sire!” or simply, “Alexa!” Whatever the signal word is, it wakes up the device. It signals
to the voice assistant that it should begin paying attention. After the voice assistant hears its signal word,
it starts to listen. The device waits for a pause to know you’ve finished your request. The voice assistant
then sends our request over to its source code. Once in the source code, our request is compared to other
requests. It’s split into separate commands that our voice assistant can understand. The source code then
sends these commands back to the voice assistant. Once it receives the commands, the voice assistant
knows what to do next. If it understands, the voice assistant will carry out the task we asked for. For
example, “Hey NOVA! What’s the weather?” NOVA reports back to us in seconds. The more directions
the devices receive, the better and faster they get at fulfilling our requests. The user gives the voice input
through microphone and the assistant is triggered by the wake up word and performs the STT (Speech to
Text) and converts it into a text and understands the Voice input and further performs the task said by the
user repeatedly and delivers it via TTS (Text to Speech) module via AIVoice.

Pillai HOC College of Engineering and Technology [Diploma Page 18


Section]
Voice Assistant using Python

List of features that can be done with the assistant:

- Playing some video which, the user wants to see.


- Telling some random fact at the start of the day with which the user can do their work in an
informative way and the user will also learn something new.
- One of the features which will be there in every assistant is playing some game so that the user can
spend their free time in a fun way.
- Users might forget to turn off the system which might contain some useful data but with a voice
assistant, we can do that even after leaving the place where the system is just by commanding the
assistant to turn the system off. As discussed about the mandatory features to be listed in voice assistant
are implemented in this work, brief explanation is given below.

API CALLS
We have used API keys for getting news information from newspaper and weather forecast from open
weather map which can accurately fetch information and give results to the user.
SYSTEM CALLS
In this feature, we have used OS & Web Browser Module to access the desktop, calculator, task
manager, command prompt & user folder. This can also restart the pc and open the chrome application.

CONTENT EXTRATION

This can Perform content extraction from YouTube, Wikipedia and Chrome using the web driver
module from selenium which provides all the implementations for the web drive like searching for a
specific video to play, to get a specific information in Google or from Wikipedia.

SERIAL MODULES
Finally, we used the serial module for implementing the Internet of Things (IOT) feature for this project.
It is a module which acquires the access for the serial port of the Adriano board and used port number
11 and COM3.

Pillai HOC College of Engineering and Technology [Diploma Section] Page 18


Voice Assistant using Python

Pillai HOC College of Engineering and Technology [Diploma Page 19


Section]
Voice Assistant using Python

CHAPTER NO:5
CONCLUSION

Pillai HOC College of Engineering and Technology [Diploma Page 20


Section]
Voice Assistant using Python

CHAPTER 5

CONCLUON

As stated before, "voice assistant is one of the biggest problem solver" and you can see that in the
proposals with the examples that it is in fact one of the biggest problem solver of the current world. We
can see that voice assistant is one of the major evolving artificial intelligence in the current world once
again on seeing the proposal examples because at the past, the best feature which a voice assistant had
was telling the date and searching the web and giving the results but now look at the functions that it can
do so with this, we can say that it is a evolving software in the current world. The main idea is to develop
the assistant even more advanced than it is now and make it the best air in the world which will save an
ample of time for its users. I would like to conclude with the statement that we will try our best and give
one of the best voice assistants which we are able to. 5.2. FUTURE SCOPE We are entering the era of
implementing voice-activated technologies to remain relevant and competitive. Voice- activation
technology is vital not only for businesses to stay relevant with their target customers, but also for
internal operations. Technology may be utilized to automate human operations, saving time for everyone.
Routine operations, such as sending basic emails or scheduling appointments, can be completed more
quickly, with less effort, and without the use of a computer, just by employing a simple voice command.
People can multitask as a result, enhancing their productivity. Furthermore, relieving employees from
hours of tedious administrative tasks allows them to devote more time to strategy meetings, brainstorming
sessions, and other jobs that need creativity and human interaction.
1) Sending Emails with a voice assistant: Emails, as we all know, are very crucial for communication
because they can be used for any professional contact, and the finest service for sending and receiving
emails is, as we all know, GMAIL. Gmail is a Google-created free email service. Gmail can be accessed
over the web or using third-party apps that use the POP or IMAP protocols to synchronize email
content. To integrate Gmail with Voice Assistant we have to utilize Gmail API. The Gmail API allows
you to access and control threads, messages, and labels in your Gmail mailbox.

Pillai HOC College of Engineering and Technology [Diploma Page 21


Section]
Voice Assistant using Python

2) Scheduling appointments using a voice assistant: The demands on our time increase as our company
grows. A growing number of people want to meet with us. We have a growing number of people who
rely on us. We must check in on certain projects or set aside time to chat with possible business leads.
There won't be enough hours in the day if we keep doing things the old way. We need to get a better
handle on our full-time schedule and devise a strategy for arranging appointments that doesn't interfere
with our most critical job. By working with a virtual scheduler or, in other words, a virtual assistant, we
let someone else worry about the organization and prioritize our schedule while we focus on the work.
3) Improved Interface of a voice assistant (VUI): Voice user interfaces (VUIs) allow users to interact
with a system by speaking commands. VUIs include virtual assistants like Amazon's Alexa and Apple's
Sire. The real advantage of a VUI is that it allows users to interact with a product without using their
hands or their eyes while focusing on anything else. -Other benefits of a Voice user interface (VUI):
Speed and Efficiency: Hands-free interactions are possible with VUIs. This method of interaction
eliminates the need to click buttons or tap on the screen. The major means of human communication is
speech. People have been using speech to form relationships for ages. As a result, solutions that allow
customers to do the same are extremely valuable. Furthermore, even for experienced testers, dictating
text messages has been demonstrated to be faster than typing. Hands-free interactions, at least in some
circumstances, save time and boost efficiency. Intuitiveness and convenience: Intuitive user flow is
required of high-quality VUIs, and technical advancements are expected to continue to improve the
intuitiveness of voice interfaces. Compared to graphical UIs, VUIs require less cognitive effort from the
user. Furthermore, everyone – from a small child to your grandmother – can communicate. As a result,
VUI designers are in a better position than GUI designers, who run the danger of producing
incomprehensible menus and exposing users to the agony of poor interface design. Customers are
unlikely to need to be instructed on how to utilize the technology by VUI makers. People can instead
ask their voice assistant for assistance.

Pillai HOC College of Engineering and Technology [Diploma Page 22


Section]
Voice Assistant using Python

REFERENCES
[1] K. Noda, H. Arie, Y. Suga, T. Ogata, Multimodal integration learning of robot behavior using deep
neural networks, Elsevier: Robotics and Autonomous Systems, 2014.

[2] Artificial intelligence (AI), sometimes called machine intelligence.


https://en.wikipedia.org/wiki/Artificial_intelligence.

[3] Deepak Sheened, RiaUmahiya, Monika Ragwort, AishwaryaBhisikar, AnupBhange, “AI Based
Voice Assistant Using Python”, Journal of Emerging Technologies and Innovative Research (JETIR),
February 2019, Volume 6, Issue 2.

[4] J. B. Allen, “From lord Rayleigh to Shannon: How do humans decode speech,” in International
Conference on Acoustics, Speech and Signal Processing, 2002.

[5] John Levis and Russian Suvorov, “Automatic Speech Recognition”.

[6] B.H. Juan and Lawrence R. Rainer, “Automatic Speech Recognition - A Brief History of the
Technology Development”.

[7] AbhayDekate, ChaitanyaKulkarni, RohanKilledar, “Study of Voice Controlled Personal Assistant


Device”, International Journal of Computer Trends and Technology (IJCTT) – Volume 42 Number 1 –
December

Pillai HOC College of Engineering and Technology [Diploma Page 23


Section]
Voice Assistant using Python

Appendix

A. Source Code

Import sub process


Import wolframalpha
Import pyttsx3
Import speech recognition as
sr Import date time
Import wikipedia
Import webbrowser
Import os
Import smtplib
Import time
Import requests
Import pyjokes
from twilio.rest import Client
Import winshell
from bs4 import BeautifulSoup
Import win32com.client as wincl
from urllib.request import urlopen
from clint.textui import progress

# Initialize text-to-speech engine


engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)

def speak(audio):
"""Function to speak given text."""
engine.say(audio)
engine.runAndWait()

def wishMe():
"""Function to greet the user based on the time of day."""
hour = datetime.datetime.now().hour
if 0 <= hour < 12:
speak("Good Morning!")
elif 12 <= hour < 18:
speak("Good Afternoon!")
else:

Pillai HOC College of Engineering and Technology [Diploma Section] Page 24


Voice Assistant using Python

speak("Good Evening!")
speak("I am your Assistant. How can I help you?")

def takeCommand():
"""Function to recognize user's voice command."""
recognizer = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
recognizer.pause_threshold = 1
audio = recognizer.listen(source)
try:
print ("Recognizing...")
query = recognizer.recognize_google(audio, language='en-
in') print(f"User said: {query}\n")
except Exception as
e:
Print(e)
print ("Unable to Recognize your voice.")
return "None"
return query.lower()

def sendEmail(to, content):


"""Function to send an
email."""
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
# Update with your email ID and password
server.login('your_email@gmail.com', 'your_password')
server.sendmail('your_email@gmail.com', to, content)
server.close()

if _name_ == '_main_':
clear = lambda:
os.system('cls') clear()
wishMe()

while True:
query = takeCommand()

if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=3)
Speak("According to Wikipedia")
Speak(results)

elif 'open youtube' in query:


speak("Here you go to
Youtube")
Voice Assistant using Python

Pillai HOC College of Engineering and Technology [Diploma Section] Page 25


Voice Assistant using Python

webbrowser. Open("https://www.youtube.com/")

elif 'open google' in query:


speak("Here you go to
Google")
webbrowser.open("https://www.google.com/")

elif 'open amazon' in query:


speak("Opening amazon")

webbrowser.open("https://www.amazon.in/s?i=kitchen&bbn=4286640031&rh=n%3A4286640031%2C
p_36%3A3444810031%2Cp_90%3A20912642031%2Cp_72%3A1318476031&dc&ds=v1%3A7NcuZ
Nyg3Jeoot3BN%2FynB7qHIRuX3MPO%2F6yAIFkH8y0&_encoding=UTF8&content-
id=amzn1.sym.7125bb39-e5c5-437d-827a-8ad948d7f157&pd_rd_r=3d5f5fe2-fe16-4004-94ad-
7bfdd4a8b86a&pd_rd_w=jC1ED&pd_rd_wg=eltQW&pf_rd_p=7125bb39-e5c5-437d-827a-
8ad948d7f157&pf_rd_r=MBGQNGC1T6GKRMEASSKC&qid=1711132165&rnid=1318475031&ref=
sr_nr_p_72_1")

elif 'play music' in query:


musicPath = r"\Users\\Shreya\\Downloads\\dancehall-124368.mp3"
os.startfile(musicPath)
speak("opening music")
# say (query)
webbrowser.open("https://pixabay.com/music/search/ncs/")

elif 'the time' in query:


strTime = datetime.datetime.now ().strftime("%H:%M:
%S") speak(f"Sir, the time is {strTime}")

elif 'open myntra' in query:


Speak("opening myntra")
webbrowser.open("https://www.myntra.com/")

elif 'email to gaurav' in


query: try:
speak("What should I say?")
content = takeCommand()
to = "receiver_email@example.com" # Replace with the recipient's email address
sendEmail(to, content)
speak("Email has been sent!")
except Exception as e:
print(e)
speak("I am not able to send this email")

elif 'send a mail' in query:


try:
Speak("What should I say?")
Content = takeCommand ()
speak ("Whom should I send?")
to = takeCommand() # Use takeCommand() to get the recipient's email address

Pillai HOC College of Engineering and Technology [Diploma Section] Page 26


Voice Assistant using Python

sendEmail (to, content)


speak ("Email has been sent!")
Except Exception as e:
print (e)
speak ("I am not able to send this email")

elif 'how are you' in query:


Speak("I am fine, Thank
you")

elif 'fine' in query or "good" in query:


speak("It's good to know that you are
fine")

elif "change my name to" in query:


query = query.replace("change my name to",
"") assname = query

elif "change name" in query:


speak("What would you like to call me?")
assname = takeCommand()
speak("Thanks for naming me")

elif "what's your name" in query or "What is your name" in


query: speak("My friends call me sneha shreya")

elif 'exit' in query:


speak("Thanks for giving me your
time") exit()

elif "who made you" in query or "who created you" in


query: speak("I have been created by Sneha and Shreya")

elif 'joke' in query:


speak(pyjokes.get_joke())

elif "calculate" in
query: try:
import wolframalpha

# Wolfram Alpha API ID


app_id = "Your_Wolfram_Alpha_API_ID"

# Create a client object


client = wolframalpha.Client(app_id)

# Find the index of 'calculate' in the query


index = query.lower().split().index('calculate')

# Extract the expression to calculate


query = query.split()[indx + 1:]

Pillai HOC College of Engineering and Technology [Diploma Section] Page 27


Voice Assistant using Python

# Query the Wolfram Alpha API


res = client.query(' '.join(query))

# Get the result and speak it


answer = next(res.results).text
print("The answer is " + answer)
speak("The answer is " +
answer)

except Exception as e:
print("An error occurred:",
e)
speak("Sorry, I couldn't calculate the answer.")

elif 'search' in query or 'play' in query:


query = query.replace("search", "")
query = query.replace("play", "")
webbrowser.open(query)

elif "who i am" in query:


speak("If you talk then definitely your human.")

elif "why you came to world" in query:


speak("Thanks to Gaurav. Further, it’s a secret")

elif 'is love' in query:


speak("It is 7th sense that destroy all other senses")

elif "who are you" in query:


speak("I am your virtual assistant created by Sneha and shreya")

elif 'reason for you' in query:


Speak("I was created as a Minor project by Sneha and shreya")

elif 'open whatsapp web' in query:


speak("opening whatsapp web")
webbrowser.open("https://web.whatsapp.com/")

elif 'open instagram' in query:


speak("opening instagram")
webbrowser.open("https://www.instagram.com/")

elif 'news' in query:


speak("opening news")
webbrowser.open('https://timesofindia.indiatimes.com/')

Pillai HOC College of Engineering and Technology [Diploma Section] Page 28


Voice Assistant using Python

elif 'lock window' in query:


speak("Locking the device")
ctypes.windll.user32.LockWorkStation()

elif 'shutdown system' in query:


speak ("Hold on a Sec! Your system is on its way to shut
down") subprocess.call('shutdown / p /f')

elif 'empty recycle bin' in query:


winshell.recycle_bin().empty(confirm=False, show progress=False, sound=True)
speak ("Recycle Bin Recycled")

elif "don't listen" in query or "stop listening" in query:


Speak("For how much time you want to stop Jarvis from listening
commands") try:
a = int (takeCommand ())
time.sleep(a)
print (a)
except Exception as
e: print(e)
speak ("Sorry, I didn't catch that.")

elif "where is" in query:


query = query.replace ("where is", "")
location = query
speak("User asked to
Locate") speak (location)
webbrowser.open("https://www.google.nl/maps/place/" + location + "")

elif "camera" in query or "take a photo" in query:


ec.capture(0, "Jarvis Camera", "img.jpg")

elif "restart" in query:


subprocess.call(["shutdown", "/r"])

Pillai HOC College of Engineering and Technology [Diploma Page 29


Section]
Voice Assistant using Python

OUTPUT

Pillai HOC College of Engineering and Technology [Diploma Section] Page 30


Voice Assistant using Python

Pillai HOC College of Engineering and Technology [Diploma Page 31


Section]
Voice Assistant using Python

Pillai HOC College of Engineering and Technology [Diploma Section] Page 32

You might also like