Skip to main content

Simple Python wrapper for eSpeak TTS engine

Project description

The pyespeakr module is designed to allow Python to send simple and fast commands to the eSpeak speech engine. This version of the module is currently a beta release and includes only the core and basic features.

Below are some examples of how to use it.

Basic usage: directly speaking text

To play a text directly, use the following command:

import pyespeakr

pyespeakr.run("en", "Hello", 175)

In the first argument, you select the language. In the second argument, you write the text in that selected language. The third argument, 175, defines the reading speed in words per minute.


Saving text to an audio file

To save text as an audio file, you can use:

import pyespeakr

pyespeakr.save_to_file("en", "Hello", 175, "file.mp3")

The first three arguments follow the same rules as the previous command. The fourth argument specifies the output file name where the audio will be saved.


Reading and playing a text file

To read the content of a file and play it directly, use:

import pyespeakr

pyespeakr.open_file("en", "file.txt", 175)

In this command, the first argument selects the language. The second argument is the file name (including its extension) whose content will be read. The third argument defines the reading speed. After execution, the text inside the file will be spoken aloud.


Converting a text file to audio

To read a file and save its content as an audio file:

import pyespeakr

pyespeakr.file_to_voice("en", "file.txt", 175, "file.mp3")

The first argument selects the language. The second argument is the file to be read. The third argument sets the reading speed. The fourth argument defines the output audio file name, which will be created after execution containing the spoken content of the input file.


Installation requirements

To use this module correctly, the eSpeak engine must be installed on your system.

Then install the Python package using:

pip install pyespeakr

After installation, you can import and use it in your projects.

The module is available on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyespeakr-0.5.6.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyespeakr-0.5.6-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file pyespeakr-0.5.6.tar.gz.

File metadata

  • Download URL: pyespeakr-0.5.6.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for pyespeakr-0.5.6.tar.gz
Algorithm Hash digest
SHA256 9d1bf6ab765e7524f3ba868dade2a2b2135e023ddf4f06e15136ad291caaad00
MD5 ea705dd26ccb39a75bcc16a05f88e9ff
BLAKE2b-256 da1157c9e8cabc14494308d823c8837eff7e361668a88eb868ba2b32bb7fc2bf

See more details on using hashes here.

File details

Details for the file pyespeakr-0.5.6-py3-none-any.whl.

File metadata

  • Download URL: pyespeakr-0.5.6-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for pyespeakr-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4399cf8f6f1c6faba4b5570f8c6a9138d1ca2f5c8705eca1da3be71c3ac2a1ce
MD5 873be72c04b2821b3ae0b778111541e2
BLAKE2b-256 7436b96a708a182415050f70717f04c592c386caa63d2b4f773d86227b3e8787

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page