DEV Community

Cover image for pyttsx3 – Offline Text-to-Speech (TTS) Engine for Python
MrRobot
MrRobot

Posted on

pyttsx3 – Offline Text-to-Speech (TTS) Engine for Python

pyttsx3 is a Python library that converts text to speech completely offline. Unlike cloud-based TTS services, it doesn’t require an internet connection and works on Windows, macOS, and Linux. It supports multiple voices, adjustable speech rate, and volume control, making it ideal for building accessibility tools, voice assistants, and educational software.


Installation:

pip install pyttsx3
Enter fullscreen mode Exit fullscreen mode

Example usage:

import pyttsx3

engine = pyttsx3.init()
engine.setProperty("rate", 150)
engine.setProperty("volume", 0.9)
engine.say("Hello, I am speaking using pyttsx3!")
engine.runAndWait()
Enter fullscreen mode Exit fullscreen mode

PyPI page: https://pypi.org/project/pyttsx3/
GitHub page: https://github.com/nateshmbhat/pyttsx3


3 Project Ideas:

  1. Build a desktop voice assistant that reads notifications or reminders.
  2. Create an audiobook generator that converts text files to speech.
  3. Develop a learning app that reads text aloud for language learners.

Top comments (0)