PyPiperTTS is a Python library that provides a simple and intuitive interface to the Piper text-to-speech system. It allows you to generate high-quality speech from text using pre-trained models.
To use PyPiperTTS, you'll need to have Python 3.6 or later installed on your system. You can install the required dependencies using pip:
pip install -r requirements.txt
To start using PyPiperTTS, create an instance of the PyPiper class:
from pypipertts import PyPiper
piper = PyPiper()
You can generate speech from text using the tts method:
output_file = piper.tts("Hello, world!")
print(output_file)
This will generate a WAV file containing the synthesized speech.
You can also stream the synthesized speech in real-time using the stream_tts method:
streamed_audio = piper.stream_tts("Hello, world!")
# play streamed audio
You can save and load model settings using the save_set and load_set methods:
# Save model settings
set_file = piper.save_set("en_US-joe-medium", 1, 1, 1, 1)
# Load model settings
model, length, noise, width, pause = piper.load_set(set_file)
print(model, length, noise, width, pause)
- Python 3.6 or later
- Piper text-to-speech system (https://github.com/rhasspy/piper)
- pydub library for audio processing
- requests library for downloading models
PyPiper is released under the MIT License.