Skip to main content

An eSpeak NG TTS binding for Python3

Project description

eSpeak NG TTS Bindings for Python3

Copyright 2016-2020 Sayak B. Licenced under GNU GPLv3.

Python Version Linux Windows FOSSA Status

Requirements

You need to have eSpeak NG installed in your system and added to the path.

Windows

The latest installers for eSpeak NG can be found here.

The installed executable may need to be added to the system path. (See here)

Ubuntu & Debian

sudo apt-get update
sudo apt-get install espeak-ng

Others

If eSpeak NG is not available in your package manager, you may need to compile the binaries for your system. Refer to this page for more information.

Installation

PyPi

This library is available on PyPi.

pip install espeakng

GitHub Releases

You can download the latest release for this library here.

Usage

First, we have to initialize a Speaker.

import espeakng

mySpeaker = espeakng.Speaker()

And then use the Speaker.say() method to speak:

mySpeaker.say('Hello, World!')

Calling Speaker.say() will interrupt any ongoing output from the same object immediately.

Use the following code if you wish to wait for any ongoing speech to complete:

mySpeaker.say('I am a demo of the say() method.', wait4prev=True)

Changing speech properties

Pitch

By default the pitch is set at 80.

Change it by:

mySpeaker.pitch = 120

Words per Minute (WPM)

By default WPM is set at 120.

Change it by:

mySpeaker.wpm = 140

Voice

By default the voice is set to 'en'. The complete list of supported voices can be found here.

Change it by:

mySpeaker.voice = 'es'

Export to .WAV file

By default, your text will just be spoken aloud, but if you want it to be written to a .WAV file, you can specify an export_path when calling the say function, as seen below:

mySpeaker.say("Export this to a file", export_path="test.wav")

Special thanks

  • MickeyDelp for wordgap and amplitude controls, and other helper methods.
  • FlorianEagox for the export to WAV file feature.

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

espeakng-1.0.3.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

espeakng-1.0.3-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file espeakng-1.0.3.tar.gz.

File metadata

  • Download URL: espeakng-1.0.3.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for espeakng-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b07f464cdca968516a0dfcc171c587d522ba366fcc4cb5e0efbda2f3e2a1bd05
MD5 54256d0bb99231305a6e0c7d210afa24
BLAKE2b-256 4a7873dc36a1c03d38f9ada0374baa8eeaf04cc0853b67a3517b1fb9d091d72b

See more details on using hashes here.

File details

Details for the file espeakng-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: espeakng-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for espeakng-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1199e7c1fa0ee3c3c6a0b68170ec2a8659ded1815794188de267fdee33d18df4
MD5 3c5aacbf4c13baab3f1d59311b77e261
BLAKE2b-256 e5fd25e124c0ee5784fbf584765e07e6e90ceaedf18b7d59b5c4c7840f20db10

See more details on using hashes here.

Supported by

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