Iotdoc 1
Iotdoc 1
On
VOICE ASSISTANT
By
M. SAI CHARAN Y21IT069
PRANEETH SAI. S Y21IT103
P. MANIDEEP Y21IT094
APRIL 2024
Department of Information Technology
R.V.R&J.C. COLLEGEOFENGINEERING
(AUTONOMOUS )
(Approved by A.I.C.T.E ) NAAC ‘A+’ Grade
(Affiliated to Acharya Nagarjuna University)
Chandramoulipuram: Chowdavaram
GUNTUR– 522019
1
R.V.R&J.C.COLLEGEOFENGINEERING
DEPARTMENTOF
INFORMATION TECHNOLOGY
BONAFIDECERTIFICATE
This is to Certify that this Mini Project work entitled “VOICE ASSISTANT” is the bonafide work
of M. SAI CHARAN (Y21IT069), PRANEETH SAI SUDA (Y21IT103), PARIMI
MANIDEEP (Y21IT094),of III/IV B.Tech who carried the work under my supervision, and
submitted in the partial fulfillment of the requirements toITSL4–IOT PROJECT LAB
REPORT during the year 2024.
2
ACKNOWLEDGEMENTS
From the idea to the act, from the conception to reality, from the emotion to the response,
from the desire to the spasm, we are led by those about whom to write for all words see
m meek.
We are very much thankful to Dr. Kolla. Srinivas, Principal of R.V.R. & J.C College
of Engineering, Guntur, for allowing us to work on this project.
We are very glad to express our special thanks to Dr. G. Swetha has inspired us to
select this project according to our choice and for her valuable advice to work on this
project.
This IOT Project wouldn’t be completed without the help of my friends, family
members and other people who are directly or indirectly connected with this work. I
also express my sincere thanks to the Technical and Non-Technical staff and all the
faculty of the department for their valuable help.
3
CONTENTS
Chapter No. &Name PageNo.
1. Abstract 5
2. List of Figures 6
3. Introduction 7
3.1. Purpose
3.2. Scope
3.3 Definitions, Acronyms and Abbreviations
4. Block Diagram & Explanation 8
5. Flow Chart & Explanation
6. Code Snippet
6.1. Raspberry Sketch
6.2. Circuit Diagram 9
7. Results 11
7.1 Hardware setup 11
7.2 Voice assistant configuration 12
7.3 Audio processing 12
7.4 Voice assistant features 13
8.Social Impact 15
9. Applications 16
10.FutureScope& Conclusion 18
Asdasfafsdafsdfasdfsdfasfsdfasdf
Asfasdfasdfuahsdjghafsdfdskjhfglkafdjs
4
adskjsdfkdsfasdf
asdkfshdjfhasdhf
1. Abstract
Asdfghj
Sdfghj
Sdfghj
5
asdfghjk
2. List of Figures
6
Introduction
asdfghjhgfdsa
7
3.1. Purpose:
The purpose of this project is to develop a voice assistant that utilizes a
Raspberry Pi and OpenAI's ChatGPT to create a versatile and interactive
system capable of processing voice commands. This project aims to build a
cost-effective and efficient solution for tasks like answering questions, setting
reminders, and controlling smart home devices, thereby providing users with
a more convenient and accessible way to interact with technology..
3.2. Scope:
8
Raspberry
Bluetooth Communication
Bluetooth is one of the popular devices to communicate in short range it
is used on computers, cell phones, headphones and many other devices.
Bluetooth devices use 2.4 to 2.5 GHz frequency to communicate with
each other. Bluetooth standardized as IEEE 802.15.1 but then it
changed that Bluetooth’s range is 2400–2483.5 MHz approximately.
Bluetooth devices generally use frequency-hopping spread spectrum
communication technique to communicate with each other.
Asdfghgfd
Asdfa
asdfdsa
9
4. Block diagram and explanation
11
5. Flowchart and explanation
The program begins by initializing and then waits for a sound input from the user
through a microphone. Once the sound is captured, the program uses speech
recognition to convert it into text. The next step is to check if this text matches a
specific wake word, like "Hey Mirror." If it does, the program proceeds to capture
the user's command by reading the sound again and converting it into text using
speech recognition. If the wake word isn't detected, the program loops back to wait
for a valid input.
After obtaining the converted text, the program checks if it matches any predefined
command. If there's a match, it executes the corresponding action. If not, the
program generates a response indicating that it didn't understand the command and
converts this response into spoken audio using text-to-speech technology. This
audio output is then played through the computer's speakers, informing the user
that the command was unrecognized. Finally, the program ends, completing its
cycle of listening, processing, and responding to voice commands. If the process
is continuous, it would loop back to wait for the wake word again.
12
Fig 5.1.Flow Chart
13
6. Code Snippet
import speech_recognition as sr
import pyttsx3
import openai
#Initializing pyttsx3
listening = True
engine = pyttsx3.init()
#Set your openai api key and customizing the chatgpt role
openai.api_key = "xyz"
messages = [{"role": "system", "content": "Your name is Jarvis and give answers in 2 lines"}]
def get_response(user_input):
messages.append({"role": "user", "content": user_input})
response = openai.ChatCompletion.create(
model = "gpt-3.5-turbo",
messages = messages
)
ChatGPT_reply = response["choices"][0]["message"]["content"]
messages.append({"role": "assistant", "content": ChatGPT_reply})
return ChatGPT_reply
while listening:
with sr.Microphone() as source:
recognizer = sr.Recognizer()
recognizer.adjust_for_ambient_noise(source)
recognizer.dynamic_energy_threshold = 3000
try:
print("Listening...")
audio = recognizer.listen(source, timeout=5.0)
response = recognizer.recognize_google(audio)
print(response)
if "jarvis" in response.lower():
response_from_openai = get_response(response)
14
engine.setProperty('rate', 120)
engine.setProperty('volume', volume)
engine.setProperty('voice', 'greek')
engine.say(response_from_openai)
engine.runAndWait()
else:
print("Didn't recognize 'jarvis'.")
except sr.UnknownValueError:
print("Didn't recognize anything.")
Circuit Diagram
15
Fig 6.2. Circuit Diagram
16
7.Results
Result Summary:
17
18
8. Social Impact
Voice assistants built on Raspberry Pi can have a profound social impact, reshaping
accessibility, education, health, automation, privacy, and human interaction. These
voice-driven systems offer improved accessibility for people with disabilities or
mobility challenges by enabling hands-free control of technology, and they can also
be used as educational tools, fostering personalized learning experiences for users
of all ages. In healthcare, voice assistants can assist the elderly or those with health
issues by managing medications and providing emergency assistance. They also
contribute to smart home automation, enhancing productivity and efficiency, but
raise significant privacy and security concerns due to the potential for unauthorized
data access. Additionally, voice assistants can influence social dynamics by altering
how people interact with technology and each other, potentially leading to reduced
face-to-face interactions and greater dependence on technology. However, the
affordability and open-source nature of Raspberry Pi make voice assistant
technology more accessible to a broader audience, promoting community-driven
innovation. Despite the potential benefits, careful consideration must be given to
privacy, security, and the societal implications of increased reliance on these
systems
19
9.Applications
20
11. FutureScope&Conclusion
Future Scope:
Conclusion:
Raspberry Pi voice assistants have made a significant impact across various
domains, from smart homes and education to healthcare and business applications.
Their flexibility and affordability, combined with the extensive Raspberry Pi
community, make them an attractive platform for voice-based projects. These voice
assistants enable hands-free interaction, improve accessibility, and facilitate
automation, contributing to increased convenience and efficiency in many areas.
However, as they become more integrated into our daily lives, challenges such as
privacy, security, and ethical considerations must be addressed to ensure responsible
use.
21
12.Bibliography.
12.1.Reference papers:
12.2. YouTubelinks:
22