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.9.tar.gz (2.9 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.9-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyespeakr-0.5.9.tar.gz
  • Upload date:
  • Size: 2.9 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.9.tar.gz
Algorithm Hash digest
SHA256 3e896f85adfed9ba8e2dd2735b10657e02ee7f505de5798fb3449ffad44b0e23
MD5 26b6806f5f54f38a4ca805e30bec27c3
BLAKE2b-256 cad0abeb33f45123d593014303b3755cb7bbe9af7620132525b5ea9e72dc29c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyespeakr-0.5.9-py3-none-any.whl
  • Upload date:
  • Size: 3.2 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 38c4c7d118a5931cd904eab5dd1f97dfdfd802f821bfed19558b53e12c729279
MD5 c5b700f759e3f3dda3ceaebd0651b606
BLAKE2b-256 73e197cb9ddda40ff814c4f5e4a7865a327beacc59a89f7724f969c2d0d2b152

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