Logix: Python voice assistant


As a student, a gamer, and a coder at the same time, I usually multitask a lot on my computer, which means leaving tons of tabs and apps open. Nevertheless, doing that would hurt my computer since I never turn them off to save time. To maximize the efficiency of my multitasking, I figure a personal voice assistant like Siri which opens and closes apps/tabs would be very convenient.

What it does

It listens to a user's commands and performs the action of closing or opening an application/tab.

How I built it

To build this app, I have to learn to incorporate different web scraping libraries with Google voice recognition and a text-to-speech engine.

The first part of the app is a platform for users to input the apps/sites that they want Logix to understand. I made this so that Logix can be personalized for different people with different purposes. The inputs are saved in 2 json files which are loaded into the Operator's list of available apps and sites

There's a voiceAi class that utilizes Google's voice recognition library. The class has 2 functions - Listen and Recognize - to listen and output the words spoken by the user.

An Operator class that utilizes selenium and os libraries to close and open applications. It has an Open and Close function incorporated in a Run(method, name) function which passes the method(close or open) and name(app or site) parameter to perform the action.

Finally, the classes are put together in our main program along with pyttsx3 text-to-speech engine to respond to the user depending on whether they ran a task successfully or when errors occur( voice could not be recognized/understood, etc. )

Challenges I ran into

The first challenge was to figure out a way to differentiate between webs and apps because one uses webdriver and one uses os to open/close.

To open/close tab, we have to navigate our driver to the right tab in order to perform the task and it was a challenge to keep track of which task to switch the driver window to.

I initially implemented a UI using Tkinter but the UI has its own loop, which interferes with the while True loop in our program. I struggled a lot to make them run simultaneously and decided to have Logix responds itself instead of having a UI.

In general, I had to learn each component before implementing them in the project and it took quite a lot of time. So I would say learning which tools to use was also a challenge for this project.

Accomplishments that I'm proud of

I am most proud of the fact that I finally made something that is useful for me. I can use this to automate my working routine.

Also, I am proud of the work I put in this project, over 10 hours on my laptop over the weekend to make it work.

What I learned

I learned the basics the web scraping, which will be an important tool for me to utilize to automate different things in the future.

I learned how to utilize the google Speech recognition system.

I was able to solidify my OOP skill and working with different types of data/variables.

What's next for Logix

I will add more apps/sites to personalize Logix and add more web scraping features such as sending email, texting friends, etc.. to make it more versatile.

I will also try to make a product that everyone can use/customize from Logix.

Built With

Share this project: