Member-only story
An Introduction to pyttsx3: A Text-To-Speech Converter for Python
A Python-based alternative for text-to-speech conversion that works offline

This article is a guide for dummies to learn text-to-speech conversion in Python. By reading this article, you’ll be exposed to the proper steps to set it up and get to know some of the basic functionalities available in the module. According to the official site for pyttsx3:
“ … is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python 2 and 3.”
In addition, this module has been tested and is known to work on the following systems:
- SAPI5 on Windows XP, Windows Vista, and Windows 8, 8.1, 10
- NSSpeechSynthesizer on Mac OS X 10.5 (Leopard) and 10.6 (Snow Leopard)
- eSpeak on Ubuntu Desktop Edition 8.10 (Intrepid), 9.04 (Jaunty), and 9.10 (Karmic)
I’ll demonstrate the capabilities of this module using the following languages:
- English (male, female)
- Chinese (female)
- Japanese (female)
There are four sections in this tutorial:
- Setup
- Basic API
- Results
- Conclusion
Let’s move on to the next section to find out more.
1. Setup
The proper way to install this module is by cloning the repository and installing via the setup Python file.
This is mainly because the published version in PyPI isn’t the latest version at the time of this writing. You can do a pip install in the future if it the developer has published the latest version on PyPi. EDIT: The package has been updated as of July 2020. You can install it easily via the following command.
pip install pyttsx3
Python module
First, clone the repository from the official GitHub site, and unzip it to a directory of your choice.
Then, open up a command line, and activate the virtual environment you prefer. Once you’re…