LibreAI / Audio / pyttsx3
// audio · nateshmbhat/pyttsx3

pyttsx3

Offline text-to-speech for Python — uses your operating system's own voices, no internet needed

★ 2.5k stars⑂ 361 forksMPL-2.0updated 2026-07
▦ visual — this project's README ships no embeddable screenshot,
so here's a placeholder. The guide below is complete regardless.
// project facts

Project facts

pyttsx3 is an open-source audio project by nateshmbhat (nateshmbhat/pyttsx3 on GitHub). It has 2,534 GitHub stars and 361 forks, is released under the MPL-2.0 license, and was last updated on GitHub on 22 July 2026.

GitHub stars
2,534
Forks
361
License
MPL-2.0
Last updated on GitHub
22 July 2026
Category
Audio
Listing
Full install guide
// how it works

How it works

  1. Clarify your goal

    Decide whether the app should speak aloud, save audio files, or both — and which installed system voices are available on your platform.

  2. Get pyttsx3

    pip install pyttsx3 (upgrade wheel first if installation errors occur).

  3. Install platform pieces

    On Linux install espeak-ng/libespeak1; on macOS with pyobjc errors, the README suggests pyobjc >= 9.0.1.

  4. Run your first utterance

    Initialize the engine, say a sentence with runAndWait(), then tune rate, volume and voice to taste.

// features

Why people love it

Fully offline

No network calls at all — synthesis uses local OS speech engines, so it works on planes and in sandboxes.

Cross-platform engines

Bundled drivers for eSpeak (Linux/macOS/Windows), NSSpeechSynthesizer and AVSpeech (macOS), and SAPI5 (Windows).

Voice selection

Enumerate the voices installed on your system and switch between them by voice ID.

Rate and volume control

Get and set speaking rate and volume (0 to 1) as engine properties.

Save to file

engine.save_to_file writes speech to an audio file (e.g. test.mp3) instead of playing it.

Tiny API

One-line pyttsx3.speak(...) for the default case, or a full engine object for control; docs at pyttsx3.readthedocs.io.

Advertisement
// run it

Run it yourself

  1. Clone the repo

    Clone pyttsx3 if you want the source; most users install from PyPI in step 2.

    git clone https://github.com/nateshmbhat/pyttsx3.git
    cd pyttsx3
  2. Install

    Install the library from PyPI (on Linux also: sudo apt install espeak-ng libespeak1).

    pip install pyttsx3
  3. Speak your first line

    Use the README's minimal example — or the one-line pyttsx3.speak("I will speak this text").

    import pyttsx3
    engine = pyttsx3.init()
    engine.say("I will speak this text")
    engine.runAndWait()
// use cases

What you can build

Advertisement
// faq

Questions, answered

Who maintains pyttsx3?

nateshmbhat maintains it, with full documentation at pyttsx3.readthedocs.io.

Is pyttsx3 free?

Yes, it is MPL-2.0 licensed and free to use.

Does it need a paid API key?

No key and no internet — it uses the voices your operating system already provides. Voice quality therefore depends on your platform's engines.

How does it compare to gTTS?

gTTS produces Google voices but needs internet and uses an unofficial endpoint. pyttsx3 is fully offline with system voices — less polished audio, but private and always available.

How do I get started?

pip install pyttsx3, then the three-line init/say/runAndWait example from the README.

// keep exploring

Similar tools

Audio

Scribe

A free offline desktop assistant for speech-to-text.

★ 39 starsMIT
View guide →
Audio

gTTS

gTTS — Python library and CLI that turns text into spoken mp3 via Google Translate's speech API

★ 2.6k starsMIT
View guide →
Audio

sherpa-onnx

Speech-to-text, text-to-speech, speaker diarization, speech enhancement, source separation, and VAD using next-gen Kaldi with onnxruntime without Internet co…

★ 15.1k starsApache-2.0
View guide →
Audio

edge-tts

Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key

★ 12.2k starsCustom
View guide →
Audio

out-loud

Free, open source, 100% offline AI text-to-speech for macOS, Windows & Linux.

★ 87 starsNOASSERTION
View guide →
// alternatives

Alternatives in Audio

The most-starred other Audio projects in the LibreAI catalogue — the realistic shortlist if pyttsx3 is not the right fit.

Get pyttsx3

Free and open — grab the source, star the repo, and start creating.