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.8.tar.gz (2.4 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.8-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyespeakr-0.5.8.tar.gz
  • Upload date:
  • Size: 2.4 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.8.tar.gz
Algorithm Hash digest
SHA256 f600b4d5c6d6ce2ad21cd15f71a7927aa570f0a27491602898aae175e11f0e45
MD5 9ed01bdedc191c7394e37fef3540e813
BLAKE2b-256 a537246265e02646744d5cbf67ae72c911a61ff70e8ba336a8e13d259dd9d4ba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyespeakr-0.5.8-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7caaf1aeea11a24668e8eb51e176ba3eafaf85ca1eef48b7ef246c70b0352361
MD5 2e21005d47fc8148279fb17e63f14ed2
BLAKE2b-256 eaad26b10872d707e55c972a74c07d597ecd2e77306228cb091d57767651f119

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