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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyespeakr-0.5.7.tar.gz
  • Upload date:
  • Size: 2.3 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.7.tar.gz
Algorithm Hash digest
SHA256 20bdad04c00ac346d662f31cc6ff4f31e58ea0ab7aa15412e3720de4ddb42ac5
MD5 8ea25bbd913b691a8f896b9fa0a454e6
BLAKE2b-256 bdf7b3efee03618286cc39fb43b79c111ac691e73e2b38aaa9386d70ad58137b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyespeakr-0.5.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2bbb335b5fa9b4a86c94bdb4553f7383f6c8769cb138b088668f8d27ae21f3b9
MD5 866b205bad3118c3a98c22654ec32440
BLAKE2b-256 3c4f9c087db784da30bcbeee6265e4884e96cfee5701571f480d6ca68ee300b7

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