We can do this with the help of Python. Python has many libraries that can help many things to be done were easy. We need the help of the terminal for doing this task. Python’s one of the best library Speech Recognition will help us to do this so.
- Pyttsx3: This is a text to speech Library in Python . We have to use pip for it.
pip install pyttsx3
- Speech Recognition module: It is module that will help us to recognize the Speech and the commands given to the computer. We have to use pip to install Speech Recognition.
pip install SpeechRecognition
- OS module: It is module in python that provides function for interacting with the operating system . OS module comes with the Python packages. Pip is not required.
Why terminal is used?
When we type shutdown in the terminal we will get many options with the help of which we can restart our computer. As we will have many tags in it. We can use “/r” with shutdown to restart.
Step 1: We have to make Speak function for making the computer communicate with us.
Step 2: We have to now make a function for taking our commands.
Step 3: Now we will make a Restart method for making the computer restart.
Step 4: Now we will have the main method.
Below is the complete Program of the above approach:
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.
- Speech Recognition in Python using Google Speech API
- Python: Convert Speech to text and text to Speech
- Python | Speech recognition on large audio files
- Python - Get Today's Current Day using Speech Recognition
- Python Script to Restart Computer
- GUI to Shutdown, Restart and Logout from the PC using Python
- Change your way to put logic in your code - Python
- Convert Text to Speech in Python
- Convert Text to Speech in Python using win32com.client
- Part of Speech Tagging with Stop words using NLTK in python
- Text-To-Speech changing voice in Python
- Python | Part of Speech Tagging using TextBlob
- Python Text To Speech | pyttsx module
- NLP | Part of Speech - Default Tagging
- NLP | Part of speech tagged - word corpus
- Python | Convert image to text and then to speech
- Python | Text to Speech by using pyttsx3
- Speech To Text using IBM Watson Studio
- Text to speech GUI convertor using Tkinter in Python
- Convert PDF File Text to Audio Speech using Python
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.