Control your Laptop with your single voice command.

Prakash Singh Rajpurohit
6 min readAug 20, 2020

--

All of us are moving towards the use of high end technology to full fill our dreams & our goals. Like in today’s era everyone wants to do less work or took the help of technology or machine to do our work. So in this article we will talk about how to use your laptop through your voice command that means we don’t have to use the keyboard & mouse pad of your laptop , just we have to run a single program from the command line & after that just speak the command or Program name & your system will open that service or program or app or whatever you want to say.

So basically here we are discussing about the use of technology & the demand of the technology for moving towards the automation process of all the work. We all know that in today’s era maximum people are using android phone in our mobile phone google assistant is available as a voice assistant , but as we know there is no function or program available on internet or in market to use your laptop or system on your single voice command.

So we are creating a program to use it as a voice assistant. So we are writing a python code to enhance the function of the our system or laptop to operate it with our voice command. So we can use this program as simple voice assistant app or program for you system. Just you have to setup the environment to run our code & then after that your entire system will controlled by your voice command.

Anyone can do this practical or run our program just their system must have the following prerequisite:

First we need a software which has the python interpreter so we have to install the Anaconda software which has inbuilt python installed.

→ Link to install the download the anaconda software :-

Download according to your respective operating system

Windows:

https://repo.anaconda.com/archive/Anaconda3-2020.07-Windows-x86_64.exe

MacOS:

https://repo.anaconda.com/archive/Anaconda3-2020.07-MacOSX-x86_64.pkg

Linux:

https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh

After download the software it would be around 400–500 MB in size & you have to install the software , for this you have to just follow all the steps as given in the below documents.

Documents Link :

Install the software according to your respective operating system

Windows:

https://docs.anaconda.com/anaconda/install/windows/

MacOS:

https://docs.anaconda.com/anaconda/install/mac-os/

Linux:

https://docs.anaconda.com/anaconda/install/linux/

So here we are performing this task on the top of Windows based operating system , so from now we will consider or follow all the steps according to the same.

If you have successfully installed the software , then after that you can check from your start menu or command prompt to check the anaconda has been successfully installed or not.

You can also follow the given document to verify the installation of anaconda software.

Document for verification

https://docs.anaconda.com/anaconda/install/verify-install/

You can also check the same from the command prompt just you have to open the command prompt in your system as shown in the image.

After that just type a command in command prompt window i.e;

conda --V or conda --version

If in your system your output is like this or something like this then it means in your system anaconda has been successfully installed . You can run the python code on your system , but to run the code you need a IDE , so here we use the by default IDE of the anaconda software i.e; Jupyter-Notebook .

So to use the Jupyter Notebook we can directly start from the start menu or we can start it from command prompt also.

If you want to open the jupyter notebook from command prompt then use this command given below :

jupyter-notebook

After this you have to install the some dependencies file to run the code , because we need some python module or package , so to use the packages or module we have to install this .

Required Packages or Modules :

  1. Pyttsx3
  2. speech_recognition
  3. datetime
  4. wikipedia
  5. pyaudio
  6. webbrowser

To install the library or packages use the given command :

pip install pyttsx3
pip install speech_recognition
pip install datetime
pip install pyaudio
pip install wikipedia
conda install webbrowser

After installing all the libraries or modules , just check the library list with the help of a command:

pip list

Now we have described all the libraries & what are the use of all the libraries & what are their functions in our code.

→ Used Library No1.

Import pyttsx3

pyttsx3 is a text-to-speech conversion library in Python

→ Used Library No2.

import speech_recognition

Recognize speech take input from the microphone, It is a library in Python

→Used Library No3.

Import datetime

Import the datetime module and display the current date and time.

→Used Library No4.

Import Wikipedia

Wikipedia is a Python library that makes it easy to access and parse data from Wikipedia.

→Used Library No5.

import webbrowser

The webbrowser module in python provides a high-level interface to allow displaying Web-based documents to users.

While we run the code we have to import the libraries in our code to use their function in our code , so we will do the same.

import pyttsx3
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import os
import smtplib
import pyaudio

After that we will write our entire code :

Practical Video of this Task:

You can connect with me on linkedin : Prakash Singh

You can get code of this task in my github account : Click here to get code.

If you find this article helpful, it would be appreciable if you could give 1 clap for it.

In Collaboration with Gagan Deep Gupta.

--

--

Prakash Singh Rajpurohit
Prakash Singh Rajpurohit

Written by Prakash Singh Rajpurohit

Cloud Stack Developer. Working on Machine Learning, DevOps, Cloud and Big Data.

No responses yet