Voice controlled System Assistant

Speech analysis

The objective of this project was to create a voice controlled assistant based on python with the help of some interesting python libraries. The program listens to the voice as an input, uses Google AI speech recognition to convert it into a text and ultimately open the particular application that is intended to open.

The code runs as follows:

import pyttsx3
import os
import speech_recognition as sr
import pyaudio

pyttsx3.speak(“Hi, This is Edgy, your own application guide. Let me help you with the applications on this computer”)

while True:
pyttsx3.speak(“Which application would you like to open:”)
print(“Which application would you like to open:”)
with sr.Microphone() as source:
print(“Start speaking…”)
print(“Speech recognized…”)

if(“run “ in p) or (“open “in p):
if(“not “ in p) or (“do not “ in p) or (“dont “ in p):

if (“notepad “in p) or (“text edittor”in p):
pyttsx3.speak(“opening notepad”)
elif(“notepad++”in p):
pyttsx3.speak(“opening Notepad++”)
elif(“wmplayer”in p):
pyttsx3.speak(“opening Windows Media Player”)
elif(“chrome”in p) or (“browser” in p):
pyttsx3.speak(“opening Google Chrome: Your internet browser”)
elif(“codeblocks”in p):
pyttsx3.speak(“opening Code Blocks: Your C compiler”)
elif(“Mozilla Firefox”in p) or (“mozilla firefox”in p) or (“firefox”in p):
pyttsx3.speak(“opening Mozilla Firefox: Your internet browser”)
os.system(“Mozilla Firefox”)
elif(“Access”in p) or (“access”in p):
pyttsx3.speak(“opening Microsoft Access”)
elif(“Excel”in p) or (“excel”in p):
pyttsx3.speak(“opening Microsoft Excel”)
elif(“Powerpoint”in p) or (“powerpoint”in p):
pyttsx3.speak(“opening Microsoft :Powerpoint”)
elif(“Word”in p) or (“word”in p):
pyttsx3.speak(“opening Microsoft Word”)
print(“dont support”)
pyttsx3.speak(“Please try again”)
elif(“close”in p) or (“stop”in p) or (“exit”in p):
pyttsx3.speak(“Thank you for using me!”)
elif(“hi “in p) or (“hello”in p) or (“hey”in p):
pyttsx3.speak(“Hello user!! Please let me know which application you want to open.”)
pyttsx3.speak(“I do not understand your command. Please repeat.”)

The above code has the capability to open applications like Notepad, Notepad++, MS Office applications and browser. More such applications can be added by inserting their destination in the path.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Check out the feedback.

Ansible: An Effective IT Automation Tool

Create a Cross-Platform Tabbed App in Flutter

How to Use the Backend for Frontend Pattern in Your Mobile App Architecture

Bézier Surfaces (CENG469 HW1)

WordPress Installation with LAMP setup : Amazon Web Services

Using Agile to release Product Features

How to mirror (copy) an entire existing Git repository into a new one

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhiroop Bas

Abhiroop Bas

More from Medium

Radiologist: Artists, robots, and what is in between

Quality Assurance in Machine Learning: A Guide to Data Labeling

Overview of PYNQ project offering FPGA capabilities to Python and data engineers.

A Blazingly-Fast DNA Search Algorithm