Using Piper
Navigate to Piper and follow the setup instructions below to run Piper locally as a TTS backend.
Setting Up Piper Locally
Method 1: Setup via Docker
Clone the artibex/piper repository:
git clone [email protected]:artibex/piper-http.gitNavigate to the
piper-httpdirectory:cd piper-httpAdd CORS support by installing Flask CORS in the Dockerfile. To do this, locate the Dockerfile and add the following line:
RUN pip install flask_corsBuild the Piper Docker image:
docker build -t http-piper .Run the Piper Docker container:
docker run --name piper -p 5000:5000 piperTo allow CORS within the Piper server, modify the
http_server.pyfile inside the running Docker container:Navigate to the
piper-httpcontainer's files:docker exec -it piper /bin/bashLocate the
http_server.pyfile:cd /app/piper/src/python_run/piperEdit
http_server.pyand add the following lines at the top to enable CORS:from flask_cors import CORS CORS(app)
Save the changes and restart the Piper server inside the container:
python3 http_server.py
Method 2: Manual Setup
Clone the repository:
git clone https://github.com/flukexp/PiperTTS-API-Wrapper.gitNavigate to the project directory:
cd PiperTTS-API-WrapperDownload piper, install Piper sample voices and start piper server:
./piper_installer.sh
Make sure Piper is enabled for TTS:
Settings -> Text-to-Speech -> TTS Backend -> PiperNotes
Piper can be used as a local text-to-speech backend in your application.
For more details on models and configurations, refer to the official Piper GitHub repository.
Last updated