Yes, it is possible with the help of terminal and some modules in Python through which one can shut down a PC by just using voice commands
- OS module: It is an in-built module in python that provides function for interacting with the operating system.
- Speech Recognition module: It is an external module in python whose functionality depends on the voice commands of the user.
- Pyttsx3 module: it is a text-to-speech conversion library in Python.
pip install SpeechRecognition pip install pyttsx3
Role of Terminal:
In terminal there are many tags for the shutdown command, however we will use the /s tag with it to shut down the system.
Below are the steps to create a program to shut doe=wn PC using Voice Commands:
Step 1: Create a class Gfg and then create its methods, create takeCommands() method to take commands as input.
Step 2: Create a Speak() method so that the computer can communicate with the user.
Step 3: Now create the quitSelf() to shut down the computer.
Step 4: Now in the driver code create a Gfg object and call the quitSelf() method.
Below is the complete program to shut down a PC using voice commands:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python Script to Shutdown Computer
- GUI to Shutdown, Restart and Logout from the PC using Python
- Get Your System Information - Using Python Script
- Change your way to put logic in your code - Python
- Voice search Wikipedia using Python
- Create a Voice Recorder using Python
- Build a Voice Recorder GUI using Python
- Voice Assistant using python
- Text-To-Speech changing voice in Python
- Personal Voice Assistant in Python
- Python | Execute and parse Linux commands
- Python exit commands: quit(), exit(), sys.exit() and os._exit()
- WebDriver Navigational Commands forward() and backward() in Selenium with Python
- Executing Shell Commands with Python
- Menu driven Python program to execute Linux commands
- Send mail from your Gmail account using Python
- Send mail with attachment from your Gmail account using Python
- Print with your own font using Python !!
- Rename all file names in your directory using Python
- Run Python script from Node.js using child process spawn() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.