Better Programming

Advice for programmers.

Follow publication

Member-only story

An Introduction to pyttsx3: A Text-To-Speech Converter for Python

Ng Wai Foong
Better Programming
Published in
7 min readDec 4, 2019
Photo by Panos Sakalakis on Unsplash

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:

  1. Setup
  2. Basic API
  3. Results
  4. 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…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Ng Wai Foong
Ng Wai Foong

Written by Ng Wai Foong

Senior AI Engineer@Yoozoo | Content Writer #NLP #datascience #programming #machinelearning | Linkedin: https://www.linkedin.com/in/wai-foong-ng-694619185/

No responses yet

Write a response