Professional Documents
Culture Documents
Voice Recognition - 103626
Voice Recognition - 103626
Voice Recognition - 103626
USING PYTHON
A Project work submitted in partial fulfillment of the requirements for
the degree of
Bachelor of Computer Applications
To the
Periyar University, Salem-11
By
YUGESH M
[C21UG155CAP054]
MAR/APR – 2024
CERTIFICATE
This is to certify to be benefited project work on“VOICE RECOGNITION”
University, Salem during the year 2024.This project, report represents an independent
work of the candidate and as not formed part of award of any degree or diploma
Place: Dharmapuri
Date:
I thank the almighty God for the blessings that have been showered upon me to
complete the project successfully. I express my heartfelt thanks to my parents who have
encouraged me in all ways to do my project.
I wish to express my thanks to Rev. Fr. Dr. Rabert Ramesh Babu SDB, Secretary and
Rector, Don Bosco College, Dharmapuri, for his constant encouragement.
I render my special thanks to Rev. Fr. Dr. J. Angelo Joseph SDB, Principal, and
Rev.Fr. Dr. S. Bharathi Bernadsha SDB, Vice-Principal, from Don Bosco College,
Dharmapuri, for their support and constant encouragement.
[YUGESH M]
ABSTRACT
VOICE ASSISTANT
1 INTRODUCTION
2 SYSTEM STUDY
5 CONCULUSION
6 BIBLIOGRAPHY
7 APPENDENCIES
A. DATA FLOW DIAGRAM
B. TABLE STRUCTURE
C. SAMPLE CODING
D. SAMPLE INPUT
E. SAMPLE OUTPUT
CHAPTER I
INTRODUCTION
Introduction:
The Voice assistants are AI-powered digital assistants that respond to voice
commands and perform various tasks or provide information based on those commands. They
utilize natural language processing (NLP) and speech recognition technologies to understand
and interpret human speech.
These assistants can be found in various devices, including smartphones, smart speakers,
smart TVs, and even in cars. They are designed to simplify tasks and enhance user experience
by providing hands-free interaction with devices and services.
Popular voice assistants include Amazon's Alexa, Apple's Siri, Google Assistant, and
Microsoft's Cortana. These assistants can perform a wide range of functions, such as setting
reminders, answering questions, playing music, controlling smart home devices, sending
messages, and providing personalized recommendations.
As technology continues to advance, voice assistants are becoming more sophisticated and
capable of understanding complex commands and engaging in more natural conversations
with users. They are increasingly integrated into our daily lives, offering convenience and
efficiency in various aspects of our interactions with technology.
1.1 ORGANIZATION PROFILE
1.2. SYSTEM SPECIFICATION
2.1.1. Drawbacks
2.2.1. Description
A voice assistant is a type of digital assistant that uses speech recognition, natural
language processing, and artificial intelligence to interpret spoken commands or questions and
perform tasks or provide information accordingly. These assistants are typically integrated into
devices such as smartphones, smart speakers, and other smart home devices, allowing users to interact
with technology through voice commands rather than traditional input methods like typing or tapping.
2.2.2 Features
Accessibility
Task Automation
Personalization
Integration
Continuous Improvemen
Modules List:
Speech Recognition:
o Purpose: This module enables your voice assistant to recognize spoken language and
convert it into text.
o Functionality: It processes audio input (speech) and provides the corresponding
textual representation.
o Example Use: Used in voice assistants like Alexa, Siri, and Google Assistant.
o Installation: You can install it using the following command:
WolframAlpha:
o Purpose: Used for computing expert-level answers using Wolfram’s algorithms and
AI technology.
o Functionality: Provides detailed information and answers based on user queries.
o Installation: pip install wolframalpha
Tkinter:
Wikipedia:
Web Browser:
Testing:
Unit Testing:
Integration Testing:
Functional Testing:
Verify that the system meets the specified functional requirements. Test
different use cases, including scheduling appointments, canceling appointments, and
viewing appointment details.
Ensure that the user interface is intuitive and user-friendly. Verify that all UI elements
are responsive and functional.
Performance Testing:
Test the system's performance under various conditions (e.g., high load).
Security Testing:
Assess the system's security measures to protect patient data. Test for
vulnerabilities and implement measures to secure the system.
Usability Testing:
Conduct usability tests to ensure the system is easy to use for both staff and
patients. Gather feedback on the user experience.
Compatibility Testing:
Ensure the system works correctly on different browsers and devices. Verify
compatibility with various operating systems.
Regression Testing:
Implementation:
Backend Development:
Dudu: Dudu is an open-source personal assistant that you can customize and
extend. It supports features like text-to-speech, automation, and offline functionality
Frontend Development:
Develop the user interface for staff and patient interactions. Ensure a
responsive design that works well on various devices.
Integration:
Integrate the frontend and backend components. Verify that data is correctly
transferred between the user interface.
Security Implementation:
Deployment:
Deploy the system to a staging environment for final testing. Once satisfied,
deploy to the production environment.
Monitoring and Support:
Gather feedback from users and stakeholders. Iterate on the system based on
feedback and continuously improve it.
CONCLUTION
CONCLUTION
BIBLIOGRAPHY
6.0. BIBLIOGRAPHY
WEBSITE
1. www.geeksforgeeks.org
2. www.w3schools.com
3, www.learnpython.org
CHAPTER VII
APPENDENCIES
APPENDENCIES
DFD INTRODUCTION
DFD is the abbreviation for Data Flow Diagram. The flow of data of a system or a
process is represented by DFD. It also gives insight into the inputs and outputs of each entity
and the process itself. DFD does not have control flow and no loops or decision rules are
present. Specific operations depending on the type of data can be explained by a flowchart.
Data Flow Diagram can be represented in several ways. The DFD belongs to structured-
analysis modeling tools. Data Flow diagrams are extremely popular because they help us to
visualize the major steps and data involved in software- system processes.
1. process
Input to output transformation in a system takes place because of process
function. The symbols of a process are rectangular with rounded corners, oval,
rectangle, or a circle. The process is named a short sentence, in one word or a
phrase to express its essence.
2. Data Flow
The data is stored in the warehouse for later use. Two horizontal lines
represent the symbol of the store. The warehouse is simply not restricted to being
a data file, rather it can be anything like a folder with documents, an optical disc, a
filing cabinet. The data warehouse can be viewed independent of its
implementation. When the data flows from the warehouse it is considered as data
reading and when data flows to the warehouse it is called data entry or data
updating.
3. Terminator
The Terminator is an external entity that stands outside of the system and
communicates with the system. It can be, for example, organizations like banks,
groups of people like customers or different departments of the same organization,
which is not a part of the model system and is an external entity. Modeled systems
also communicate with terminators.
4. The name of the entity should be easy and understandable without any extra
assistance(like comments).
6. The DFD should maintain consistency across all the DFD levels.
7. A single DFD can have maximum processes up to nine and minimum three
processes.
Levels of DFD
Uses hierarchy to maintain transparency thus multilevel DFD’s can be created.
Levels of DFD are as follows:
7.6 0-level DFD
10. Data Flow Diagram represents detailed and well explained diagram of
system components.
Disadvantages of DFD
13. At times DFD can confuse the programmers regarding the system.
14. Data Flow Diagram takes a long time to be generated, and many times due
to this reasons analyst are denied permission to work on it.
DATA FLOW DIAGRAM
C. SAMPLE CODING
import speech_recognition as sr
import pyttsx3
import datetime
import wikipedia
import webbrowser
import os
import time
import subprocess
import wolframalpha
import json
import requests
import smtplib
import config
EMAIL_DIC = {
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty('voice','voices[0].id')
def speak(text):
engine.say(text)
engine.runAndWait()
def wishMe():
hour=datetime.datetime.now().hour
speak("Hello,Good Morning")
print("Hello,Good Morning")
speak("Hello,Good Afternoon")
print("Hello,Good Afternoon")
else:
speak("Hello,Good Evening")
print("Hello,Good Evening")
def takeCommand():
r=sr.Recognizer()
print("Listening...")
audio=r.listen(source)
try:
statement=r.recognize_google(audio,language='en-in')
print(f"user said:{statement}\n")
except Exception as e:
return "None"
return statement
wishMe()
if __name__=='__main__':
while True:
statement = takeCommand().lower()
if statement==0:
continue
break
if 'wikipedia' in statement:
speak('Searching Wikipedia...')
speak("According to Wikipedia")
print(results)
speak(results)
webbrowser.open_new_tab("https://www.youtube.com")
speak("youtube is open now")
time.sleep(5)
webbrowser.open_new_tab("https://www.google.com")
time.sleep(5)
api_key="8ef61edcf1c576d65d836254e11ea420"
base_url="https://api.openweathermap.org/data/2.5/weather?"
city_name=takeCommand()
complete_url=base_url+"appid="+api_key+"&q="+city_name
response = requests.get(complete_url)
x=response.json()
if x["cod"]!="404":
y=x["main"]
current_temperature = y["temp"]
current_humidiy = y["humidity"]
z = x["weather"]
weather_description = z[0]["description"]
str(current_temperature) +
str(current_humidiy) +
str(weather_description))
str(current_temperature) +
str(current_humidiy) +
str(weather_description))
else:
strTime=datetime.datetime.now().strftime("%H:%M:%S")
'in different cities , get top headline news from times of india and you can ask me
computational or geographical questions too!')
elif "who made you" in statement or "who created you" in statement or "who discovered
you" in statement:
webbrowser.open_new_tab("https://stackoverflow.com/login")
speak("Here is stackoverflow")
news =
webbrowser.open_new_tab("https://timesofindia.indiatimes.com/home/headlines")
time.sleep(6)
elif "camera" in statement or "take a photo" in statement:
ec.capture(0,"robo camera","img.jpg")
webbrowser.open_new_tab(statement)
time.sleep(5)
speak('I can answer to computational and geographical questions and what question
do you want to ask now')
question=takeCommand()
app_id="R2K75H-7ELALHR35X"
client = wolframalpha.Client('R2K75H-7ELALHR35X')
res = client.query(question)
answer = next(res.results).text
speak(answer)
print(answer)
speak("Ok , your pc will log off in 10 sec make sure you exit from all applications")
subprocess.call(["shutdown", "/l"])
time.sleep(3)
D. SAMPLE INPUT
Date.py
import datetime
def date():
"""
Just return date as string
:return: date if success, False if fail
"""
try:
date = datetime.datetime.now().strftime("%b %d %Y")
except Exception as e:
print(e)
date = False
return date
def time():
"""
Just return time as string
:return: time if success, False if fail
"""
try:
time = datetime.datetime.now().strftime("%H:%M:%S")
except Exception as e:
print(e)
time = False
return time
google search,py
def speak(text):
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voices', voices[0].id)
engine.say(text)
engine.runAndWait()
engine.setProperty('rate', 180)
def google_search(command):
Wikipedia.py
import wikipedia
import re
def tell_me_about(topic):
try:
# info = str(ny.content[:500].encode('utf-8'))
# res = re.sub('[^a-zA-Z.\d\s]', '', info)[1:]
res = wikipedia.summary(topic, sentences=3)
return res
except Exception as e:
print(e)
return False
Youtube.py
# make the final url of song selects the very first result from youtube result
url = "http://www.youtube.com/watch?v="+str(search_results)
# play the song using webBrowser module which opens the browser
# webbrowser.open(url, new = 1)
webbrowser.open_new(url)
Webside.py
import webbrowser
def website_opener(domain):
try:
url = 'https://www.' + domain
webbrowser.open(url)
return True
except Exception as e:
print(e)
return False
E. SAMPLE OUTPUT
Display.py
Future Enhancement
Future:
Command Execution:
Voice assistants can perform a wide range of tasks, including:
Opening apps
Sending messages
Making calls
Playing music
Checking the weather
Controlling smart devices
Setting timers and alarms
Providing general information