Kooky
Kooky
KOOKY
CLASS: XI
1
PROJECT GUIDE: Mr. MANISH TIWARI PGT(CS)
CERTIFICATE
(…………..)
PGT Comp Sci
Principal:
Name: Dr. Vineet Gaba
Signature:
2
TABLE OF CONTENTS [ T O C ]
01 ACKNOWLEDGEMENT 04
02 INTRODUCTION 05
03 PROPOSED SYSTEM 06
07 EXPLANATION OF CODE 11
08 SOURCE CODE 29
09 TESTING 22
11 BIBLIOGRAPHY 26
3
ACKNOWLEDGEMENT
Apart from the efforts of us, the success of any project depends largely on the
encouragement and guidelines of many others. We take this opportunity to express our
gratitude to the people who have been instrumental in the successful completion of this
project.
We express deep sense of gratitude to almighty God for giving us strength for
the successful completion of the project.
We express our deep sense of gratitude to the luminary The Principal, MAA
KALYANILA PUBLIC SCHOOL who has been continuously motivating and extending their
helping hand to us.
The guidance and support received from all the members who contributed and
who are contributing to this project, was vital for the success of the project. We are
grateful for their constant support and help.
4
PROJECT ON KOOKY THE VOICE
ASSISTANT (AI)
INTRODUCTION
Have you ever wondered how cool it would be to have your own A.I. assistant?
Imagine how easier it would be to send emails without typing a single word, doing
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, We
Wondered and here are the results.
Voice assistants have become so popular since their emergence in 2014 that
many of us now consider them part of the family. They use artificial intelligence (AI) to
make our day-to-day easier and go a long way towards improving the lives of persons
with disabilities.
5
PROPOSED SYSTEM
Today one cannot afford to rely on the fallible human beings of be really wants to stand
against today’s merciless competition where not to wise saying “to err is human” no
longer valid, it’s outdated to rationalize your mistake. So, to keep pace with time, to
bring about the best result without malfunctioning and greater efficiency.
In the Modern Era of fast-moving technology humans developed applications like
Personal Voice Assistant having the ability to interact with the surroundings by human
interaction i.e., HUMAN VOICE. Web Engineering has become a major delivery platform
for a variety of complex and sophisticated enterprise applications in several domains.
Education gives us knowledge of the world around us and changes it into something
better and also develops in us a perspective of looking at life so we had set the scope to
Institute level. So, we are going to develop a Web Engineering application for the
Education domain wherein it will be used by the role of Professors and students. In this
proposed system, the Professor's voice assistant would be able to set and extend
timelines of assignments or any schedule exam. Professors can also set their respective
lectures timetable so that they can get reminders whenever the lecture is scheduled. At
the Institute level it will be integrated with the features like students curricular tracking
which will help the professors to analysis and track their curriculum growth. The
students can set alerts for their exams or for any required notes, view the Timetable
from a web page and extract the details related to Exams or any respective Subject using
voice Recognition by using the ASP.Net Framework and AI. The Principal of Institute or
any Higher Authority person can View the details of Professors via Voice Commands.
6
OBJECTIVE OF THE PROJECT
stay in the know: We can get all kinds of information found on the Internet, as
well as asking about the weather, latest news, traffic and others.
listen to music: We can ask them to play the music that suits our mood at any
given time.
control other devices: We can tell them to connect to other smart appliances
and follow commands like “switch on the television”.
check our bank balance: Some banks let us access our accounts through them
to ask about our balance and transactions, and even request products like cards.
stick to a schedule: It’s an easy way to organize our time without needing a
mobile, watch or diary.
help persons with disabilities: Their voice search function makes things easier
for the visually-impaired, elderly and dependant persons.
enhance security: We can connect our home’s security cameras to them and
watch a live feed on our devices anytime, anywhere.
7
SYSTEM DEVELOPMENT LIFE
CYCLE (SDLC)
8
PHASES OF SYSTEM
DEVELOPMENT LIFE CYCLE
Analysis/Feasibility: For an SDLC strategy to work there should
be a strong idea of what deficiencies exist in the current
structure and the goals for the new approach. A feasibility
study determines if you can or should accomplish the goals of
the plan. Information is gathered and analyzed to identify
what technical assets, personnel, and training is already in
place and utilized. The study also inventories what is needed
to augment or replace, and at what cost. During this phase
you determine the overall project scope, including economic,
operational and human factors, identify key personnel, and
develop timelines.
Planning/Requirements: A plan can include adapting a current
system to meet new needs or developing a completely new
system. This phase defines user requirements, identifies
needed features, functions, and customizations, and
investigates overall capabilities
Design: Once you make the plan and identify costs, systems,
and user requirements, a detailed system design can begin
that includes features and other documentation. The
architects can then build a sample framework.
System Development: An approved design is the catalyst for
authorizing development for the new or augmented system.
Some say that this is the most robust part of the life cycle.
During this phase, developers write code and you construct
and fine-tune technical and physical configurations.
Testing: Users are brought in to test before deployment to
identify areas of concern or improvement.
9
Deployment: The system is put into a production environment
and used to conduct business.
Maintenance: The cyclical nature of SDLC recognizes that the
process of change and upgrading are constant. Carry out the
replacement of outdated hardware/software, security
upgrades, and continuous improvement on a regular basis.
Evaluation: An often-overlooked element of any large-scale
system roll-out is the evaluation process, which supports the
continuous improvement of the system. The team
continuously reviews what is working and what is in need of
improvement. This can mean recommending additional
training, procedures, or upgrades.
Disposition/Disposal/End-of-Life: A well-rounded life cycle
identifies and decommissions surplus or obsolete assets at the
end of their life cycle. Included in this phase is the secure
retrieval of data and information for preservation, as well
as, the physical disposition of an asset.
10
Explanation of code
Modules Needed –
Subprocess: - This module is used to get system subprocess
details used in various commands i.e., Shutdown, Sleep, etc.
This module comes built-in with Python.
Wolfram Alpha: - It is used to compute expert-level answers
using Wolfram’s algorithms, knowledgebase and AI
technology.
Pyttsx3: - This module is used for the conversion of text to
speech in a program it works offline.
Tkinter: - This module is used for building GUI and comes
inbuilt with Python. This module comes built-in with Python.
Wikipedia: - As we all know Wikipedia is a great source of
knowledge just like GeeksforGeeks we have used the
Wikipedia module to get information from Wikipedia or to
perform a Wikipedia search.
Speech Recognition: - Since we’re building an application of
voice assistant, one of the most important things in this is that
your assistant recognizes your voice (means what you want to
say/ ask).
Web browser: - To perform Web Search. This module comes
built-in with Python.
Ecapture:- To capture images from your Camera.
Pyjokes:- Pyjokes is used for the collection of Python Jokes
over the Internet.
Datetime:- Date and Time are used to showing Date and Time.
This module comes built-in with Python.
Twilio:- Twilio is used for making calls and messages.
Requests:- Requests is used for making GET and POST
requests.
BeautifulSoup:- Beautiful Soup is a library that makes it easy
to scrape information from web pages.
11
Implementation
Defining Speak Function
The first and foremost thing for an A.I. assistant is that it should be
able to speak. To make our kooky talk, we will make a function
called speak(). 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.
import pyttsx3
engine = pyttsx3.init('sapi5')
voices= engine.getProperty('voices')
engine.setProperty('voice', voice[0].id)
Writing Our speak() Function :
We made a function called speak() at the starting of this tutorial. Now, we will
write our speak() function to convert our text to speech.
def speak(audio):
engine.say(audio)
engine.runAndWait()
Creating Our main() function:
We will create a main() function, and inside this main() Function, we will call our
speak function.
12
if __name__=="__main__" :
speak("Hello Goldy")
Whatever you will write inside this speak() function will be converted into speech.
Defining Wish me Function :
Now, we will make a wishme() function that will make our J.A.R.V.I.S. wish or
greet the user according to the time of computer or pc. To provide current or live
time to A.I., we need to import a module called datetime. Import this module
to your program by:
import datetime
def wishme():
hour = int(datetime.datetime.now().hour)
Here, we have stored the current hour or time integer value into a variable named
hour. Now, we will use this hour value inside an if-else loop.
import speechRecognition as sr
def takeCommand():
13
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(f"User said: {query}\n")
except Exception as e:
Now, we will develop logic for different commands such as Wikipedia searches,
playing music, etc.
Defining Task 1: To search something 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 :
if __name__ == "__main__":
wishMe()
while True:
query = takeCommand().lower()
14
if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=2)
speak("According to Wikipedia")
print(results)
speak(results)
Here, we are using an elif loop to check whether Youtube is in the user's query.
Let' suppose the user gives a command as "kooky, open youtube." So, open
youtube will be in the user's query, and the elif condition will be true.
Defining Task 3: To open Google site in a web-browser
elif 'open google' in query:
webbrowser.open("google.com")
We are opening Google in a web-browser by applying the same logic that we used
to open youtube.
Defining Task 4: To play music
To play music, we need to import a module called os. Import this module directly
with an import statement.
15
elif 'play music' in query:
music_dir = 'D:\\Non Critical\\songs\\Favorite
Songs2'
songs = os.listdir(music_dir)
print(songs)
os.startfile(os.path.join(music_dir, songs[0]))
In the above code, we first opened our music directory and then listed all the
songs present in the directory with the os module's help. With the help
of os.startfile, you can play any song of your choice. I am playing the first
song in the directory. However, you can also play a random song with the help of
a random module. Every time you command to play music, kooky will play any
random song from the song directory.
Defining Task 5: To know the current time
elif 'the time' in query:
strTime = datetime.datetime.now().strftime("%H:
%M:%S")
speak(f"Sir, the time is {strTime}")
In the above, code we are using the datetime() function and storing the current or
live system time into a variable called strTime. After storing the time in strTime,
we are passing this variable as an argument in speak function. Now, the time string
will be converted into speech.
Defining Task 6: To open the VS Code Program
elif 'open code' in query:
codePath = "C:\\Users\\Akshay Pratap\\AppData\\
Local\\Programs\\Microsoft VS Code\\Code.exe"
os.startfile(codePath)
To open the VS Code or any other application, we need the code path of the
application.
Defining Task 7: To send Email
To send an email, we need to import a module called smtplib.
What is smtplib?
16
Simple Mail Transfer Protocol (SMTP) is a protocol that allows us to
send emails and route emails between mail servers. An instance method
called sendmail is present in the SMTP module. This instance method
allows us to send an email. It takes 3 parameters:
The sender: Email address of the sender.
The receiver: T Email of the receiver.
The message: A string message which needs to be sent to one or more
than one recipient.
In the above code, we are using the SMTP module, which we have already discussed above.
Calling sendEmail() function inside the main() function:
elif 'email to xyz' in query:
try:
speak("What should I say?")
content = takeCommand()
to = "xyz@gmail.com"
sendEmail(to, content)
speak("Email has been sent!")
except Exception as e:
print(e)
speak("Sorry my friend. I am not able to
send this email")
17
We are using the try and except block to handle any possible error while sending
emails.
Recapitulate
1. First of all, we have created a wishme() function that gives the greeting
functionality according to our A.I system time.
2. After wishme() function, we have created a takeCommand() function,
which helps our A.I to take command from the user. This function is also
responsible for returning the user's query in a string format.
3. We developed the code logic for opening different websites like google,
youtube, and stack overflow.
4. Developed code logic for opening VS Code or any other application.
5. At last, we added functionality to send emails
18
Source Code
import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import webbrowser
import os
import smtplib
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
def wishMe():
hour = int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning")
else:
speak("Good Evening")
def takeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
r.pause_threshold = 1
audio = r.listen(source)
try:
print("Recognizing...")
19
query = r.recognize_google(audio, language='en-in')
print("User said: ", query )
except Exception as e:
#print(e)
if __name__=="__main__":
wishMe()
while True:
#2if 1:
query = takeCommand().lower()
if 'wikipedia' in query:
speak("Searching Wikipedia...")
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=2)
speak("According to Wikipedia")
print(results)
speak(results)
20
os.startfile(os.path.join(music_dir, songs[0]))
21
TESTING
Software Testing is an empirical investigation conducted to provide
stakeholders with information about the quality of the product or service
under test[1], with respect to the context in which it is intended to operate.
Software Testing also provides an objective, independent view of the software
to allow the business to appreciate and understand the risks at
implementation of the software. Test techniques include, but are not limited
to, the process of executing a program or application with the intent of finding
software bugs.
It can also be stated as the process of validating and verifying that a software
program/application/product meets the business and technical requirements
that guided its design and development, so that it works as expected and can
be implemented with the same characteristics. Software Testing, depending
on the testing method employed, can be implemented at any time in the
development process, however the most test effort is employed after the
requirements have been defined and coding process has been completed.
TESTING METHODS
Software testing methods are traditionally divided into black box testing and
white box testing. These two approaches are used to describe the point of
22
partitioning, boundary value analysis, all-pairs testing, fuzz testing, model-
based testing, traceability matrix, exploratory testing and specification-based
testing.
SPECIFICATION-BASED TESTING
Specification-based testing aims to test the functionality of software
according to the applicable requirements.[16] Thus, the tester inputs
data into, and only sees the output from, the test object. This level
of testing usually requires thorough test cases to be provided to the
tester, who then can simply verify that for a given input, the output
value (or behaviour), either "is" or "is not" the same as the expected
value specified in the test case. Specification-based testing is
necessary, but it is insufficient to guard against certain risks.
23
White box testing, by contrast to black box testing, is when the tester has
access to the internal data structures and algorithms (and the code that
implement these).
24
HARDWARE AND SOFTWARE
REQUIREMENTS
4200+ DUALCORE)
25
SOFTWARE REQUIREMENTS:
I. Windows OS
II. Python
BIBLIOGRAPHY
1 .A Project Report On Blood Bank Management System (BBMS) By :
Praveen M Jigajinni
2.Website: https://www.w3resource.com
3.Website: geekforgeeks.org
4.Website: Glitch.com
5.Manish sir
26