Py Report
Py Report
1.Rationale: -
Blaze is an AI-based voice assistant designed to perform basic computer tasks through voice
commands. It integrates speech recognition, text-to-speech synthesis, and web automation, providing an
interactive and efficient user experience. The project helps understand Python libraries such as speech
recognition, pyttsx3, and webbrowser, enhancing the understanding of AI-driven voice control systems.
3. Literature Review: -
Voice assistants like Alexa, Siri, and Google Assistant have revolutionized human-computer
interaction. Studies show that voice-based systems improve accessibility, productivity, and user
engagement. Python is widely used for building AI projects due to its extensive library support.
Implementing Blaze using Python helps explore AI principles, enhances coding skills, and provides
practical exposure to speech recognition and automation.
5. Resources Required: -
Name of
Sr. no Specification Quantity Remark
Resources
Processor: - Intel core i5,
RAM: - 8 GB It is used to perform some
Computer
1) Operating System: - Windows project related task.
System 1
11.
Python 3.12 For coding and testing
2) Software 1
Blaze
| speech_recognition, pyttsx3,
Python For speech recognition,
wikipedia, webbrowser, os,
3) Libraries - voice output, and task
datetime
automation.
VOICE ASSISTANCE 2024-2025
6. Report: -
Introduction
Blaze is a voice-activated AI assistant that listens to user commands, recognizes them using Google's
speech recognition, and responds with appropriate actions or information. It can open websites, play
music, provide time updates, create folders, and more — making tasks faster and hands-free.
Working of Blaze:
Input Parameters:
Process:
Blaze uses speech recognition to convert audio into text.
It compares the command to predefined tasks.
Executes the corresponding action (e.g., open YouTube, play music, tell time). Output:
Blaze responds with a voice output, confirming the action.
Performs the requested task.
Features:
Greets user according to time (morning, afternoon, evening).
Executes voice-based commands.
Provides Wikipedia summaries.
Opens websites like YouTube and Google.
Plays music from a local directory.
Tells the current time.
Opens VS Code or other software.
Creates folders by voice command.
Introduces itself and its creator.
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
engine.setProperty('rate', 170)
def speak(audio):
engine.say(audio)
engine.runAndWait()
def wishMe():
hour = int(datetime.datetime.now().hour)
if hour >= 0 and hour < 12:
speak("Good Morning!")
elif hour >= 12 and hour < 18:
speak("Good Afternoon!")
else:
speak("Good Evening!")
speak("I am Blaze Sir, Please tell me how may I help you.")
def takeCommand():
VOICE ASSISTANCE 2024-2025
r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
r.pause_threshold = 0.5
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:
print("Say that again please...")
return "None"
return query
if __name__ == "__main__":
wishMe()
while True:
query = takeCommand().lower()
if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=2)
speak("According to Wikipedia")
speak(results)
elif 'open youtube' in query:
webbrowser.open('youtube.com')
elif 'open google' in query:
webbrowser.open('google.com')
elif 'play music' in query:
music_dir = 'C:\\Users\\Admin\\Music'
songs = os.listdir(music_dir)
VOICE ASSISTANCE 2024-2025
os.startfile(os.path.join(music_dir, songs[0]))
elif 'the time' in query:
strTime = datetime.datetime.now().strftime("%H:%M:%S")
speak(f"Sir, the time is {strTime}")
elif 'open code' in query:
codepath = "C:\\Users\\Admin\\Desktop\\Visual Studio Code"
os.startfile(codepath)
elif 'create folder' in query:
query = query.replace("create folder", "")
os.makedirs(f"{query}")
speak(f"{query} folder is created")
elif 'creator' in query:
speak("I was created by Sanskar in Sharad Polytechnic")
elif 'are you' in query:
speak("I am an AI voice assistant. My name is Blaze")
elif 'bye' in query:
speak("Goodbye Sir, feel free to ask anything.")
break
VOICE ASSISTANCE 2024-2025
Output:
Advantages
Disadvantages
8. Future Improvement: -
Extended Command Library: Add support for more complex commands and multi-step tasks.
Offline Mode: Implement offline speech recognition for tasks without internet access.
Personalization: Allow users to customize commands and responses.
Enhanced AI Capabilities: Integrate machine learning to enable more dynamic, context-aware
conversations.
9. Conclusion: -
Blaze is an effective, interactive voice assistant that simplifies basic computer tasks through voice
commands. It enhances accessibility, improves productivity, and showcases AI integration using Python.
This project deepens the understanding of speech recognition, automation, and Python library integration,
providing a strong foundation for future AI-based projects.
10. References: -
Python Speech Recognition Documentation: https://pypi.org/project/SpeechRecognition/