jp6/cu129/: piper-1.3.0 metadata and description

Homepage Simple index

Fast and local neural text-to-speech engine

author The Home Assistant Authors
author_email hello@home-assistant.io
classifiers
  • Development Status :: 3 - Alpha
  • Intended Audience :: Developers
  • Topic :: Text Processing :: Linguistic
  • Programming Language :: Python :: 3.9
  • Programming Language :: Python :: 3.10
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3.12
  • Programming Language :: Python :: 3.13
description_content_type text/markdown
keywords home, assistant, tts, text-to-speech
license Apache-2.0
requires_dist
  • torch<3,>=2; extra == "train"
  • lightning<3,>=2; extra == "train"
  • tensorboard<3,>=2; extra == "train"
  • tensorboardX<3,>=2; extra == "train"
  • jsonargparse[signatures]>=4.27.7; extra == "train"
  • pathvalidate<4,>=3; extra == "train"
  • onnx<2,>=1; extra == "train"
  • pysilero-vad<3,>=2.1; extra == "train"
  • cython<4,>=3; extra == "train"
  • librosa<1; extra == "train"
  • black==24.8.0; extra == "dev"
  • flake8==7.1.1; extra == "dev"
  • mypy==1.14.0; extra == "dev"
  • pylint==3.2.7; extra == "dev"
  • pytest==8.3.4; extra == "dev"
  • build==1.2.2; extra == "dev"
  • scikit-build<1; extra == "dev"
  • cmake<4,>=3.18; extra == "dev"
  • ninja<2,>=1; extra == "dev"
  • flask<4,>=3; extra == "http"
requires_python >=3.9

Because this project isn't in the mirror_whitelist, no releases from root/pypi are included.

File Tox results History
piper-1.3.0-cp312-cp312-linux_aarch64.whl
Size
13 MB
Type
Python Wheel
Python
3.12

Piper 1 (GPL)

A self-contained version of Piper, the fast and local neural text-to-speech engine.

This version directly embeds espeak-ng and therefore has a GPL license.

Installing

Install with:

pip install piper1-tts

Downloading Voices

List voices with:

python3 -m piper.download_voices

Choose a voice (samples here) and download. For example:

python3 -m piper.download_voices en_US-lessac-medium

This will download to the current directory. Override with --data-dir <DIR>

Running

After downloading the example voice above, run:

python3 -m piper -m en_US-lessac-medium -f test.wav -- 'This is a test.'

This will write test.wav with the sentence "This is a test." If you have voices in a different directory, use --data-dir <DIR>

If you have ffplay installed, omit -f to hear the audio immediately:

python3 -m piper -m en_US-lessac-medium -- 'This will play on your speakers.'

Running Piper this way is slow since it needs to load the model each time. Run the web server unless you need to stream audio (see --output-raw from --help).

Some other useful command-line options:

Raw Phonemes

You can inject raw espeak-ng phonemes with [[ <phonemes> ]] blocks. For example:

I am the [[ bˈætmæn ]] not [[bɹˈuːs wˈe‍ɪn]]

To get phonemes from espeak-ng, use:

espeak-ng -v <VOICE> --ipa=3 -q <TEXT>

For example:

espeak-ng -v en-us --ipa=3 -q batman
bˈætmæn

Web Server

Install the necessary dependencies:

python3 -m pip install piper1-tts[http]

After downloading the example voice above, run:

python3 -m piper.http_server -m en_US-lessac-medium

This will start an HTTP server on port 5000 (use --host and --port to override). If you have voices in a different directory, use --data-dir <DIR>

Now you can get WAV files via HTTP:

curl -X POST -H 'Content-Type: application/json' -d '{ "text": "This is a test." }' -o test.wav localhost:5000

The JSON data fields area:

Get the available voices with:

curl localhost:5000/voices

Training New Voices

See TRAINING.md

Building Manually

We use scikit-build-core along with cmake and swig to build a Python module that directly embeds espeak-ng.

You will need the following system packages installed (apt-get):

To create a dev environment:

git clone https://github.com/OHF-voice/piper1-gpl.git
cd piper1-gpl
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -e .[dev]

Next, run script/dev_build or manually build the extension:

python3 setup.py build_ext --inplace

Now you should be able to use script/run or manually run Piper:

python3 -m piper --help

You can manually build wheels with:

python3 -m build