title: Using Piper
Navigate to Piper and follow the setup instructions below to run Piper locally as a TTS backend.
Clone the artibex/piper repository:
git clone [email protected]:artibex/piper-http.git
Navigate to the piper-http directory:
cd piper-http
Add CORS support by installing Flask CORS in the Dockerfile. To do this, locate the Dockerfile and add the following line:
RUN pip install flask_cors
Build the Piper Docker image:
docker build -t http-piper .
Run the Piper Docker container:
docker run --name piper -p 5000:5000 piper
To allow CORS within the Piper server, modify the http_server.py file inside the running Docker container:
Navigate to the piper-http container's files:
docker exec -it piper /bin/bash
Locate the http_server.py file:
cd /app/piper/src/python_run/piper
Edit http_server.py and 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
Clone the repository:
git clone https://github.com/flukexp/PiperTTS-API-Wrapper.git
Navigate to the project directory:
cd PiperTTS-API-Wrapper
Download piper, install Piper sample voices and start piper server:
./piper_installer.sh
Settings -> Text-to-Speech -> TTS Backend -> Piper