There are several APIs available to convert text to speech in python. One of such APIs available in the python library commonly known as win32com library. It provides a bunch of methods to get excited about and one of them is the Dispatch method of the library. Dispatch method when passed with the argument of SAPI.SpVoice It interacts with the Microsoft Speech SDK to speak what you type in from the keyboard.
Input : Hello World Output : Input : 121 Output :
To install the win32com.client module , open terminal and write
pip install pypiwin32
This works on Windows platform. Now we are all set to write a sample program that converts text to speech.
Welcome to geeks for geeks
This article is contributed by Subhajit Saha. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Python: Convert Speech to text and text to Speech
- Speech Recognition in Python using Google Speech API
- Convert PDF File Text to Audio Speech using Python
- Convert Text to Speech in Python
- Python | Convert image to text and then to speech
- Python | Text to Speech by using pyttsx3
- Text to speech GUI convertor using Tkinter in Python
- Speech To Text using IBM Watson Studio
- Text-To-Speech changing voice in Python
- Python Text To Speech | pyttsx module
- Converting Text to Speech in Java
- Convert Text and Text File to PDF using Python
- Part of Speech Tagging with Stop words using NLTK in python
- Python | Part of Speech Tagging using TextBlob
- Python - Get Today's Current Day using Speech Recognition
- Python | Speech recognition on large audio files
- NLP | Part of Speech - Default Tagging
- NLP | Part of speech tagged - word corpus
- Restart your Computer with Speech Recognition
- Convert Text File to CSV using Python Pandas