Funky Talker is a small Flask text-to-speech prototype that uses local Piper voice models. Enter text in the web page, choose a voice, submit the form, and the app generates a WAV file that can be played back in the browser.
The app can run either directly with local Python or inside Docker. The Docker image includes Python, Flask, and Piper; the voice models stay outside the image and are mounted into the container at runtime.
- Flask web interface for entering text
- Voice selection from locally installed Piper
.onnxmodels - Browser playback of generated WAV audio
- Configurable Piper command through
PIPER_COMMAND - Docker image build and run workflow
- Local model files kept out of git
funky_talker/
|-- Dockerfile
|-- requirements.txt
|-- funky_talker.py
|-- templates/
| `-- index.html
|-- static/
| `-- output.wav # generated at runtime
|-- models/ # local Piper models, not committed
|-- input.txt # generated at runtime
|-- .dockerignore
`-- .gitignore
For local Python:
- Python 3
- Flask
- Piper text-to-speech
- One or more Piper voice models
For Docker:
- Docker Desktop
- One or more Piper voice models
Voice models are available from:
https://huggingface.co/rhasspy/piper-voices
Voice models are not included in this repository because they are large binary files. Each Piper voice usually has two files:
voice-name.onnx
voice-name.onnx.json
Place both files in the local models/ folder.
The current app expects these model files:
models/en_US-lessac-medium.onnx
models/en_US-lessac-medium.onnx.json
models/en_US-lessac-high.onnx
models/en_US-lessac-high.onnx.json
models/en_GB-northern_english_male-medium.onnx
models/en_GB-northern_english_male-medium.onnx.json
models/en_US-john-medium.onnx
models/en_US-john-medium.onnx.json
models/en_US-kristin-medium.onnx
models/en_US-kristin-medium.onnx.json
To add another voice, download the .onnx and .onnx.json files, place them in
models/, then add an entry to the VOICE_MODELS dictionary in
funky_talker.py.
Create and activate a virtual environment:
python -m venv .venv
.\.venv\Scripts\Activate.ps1Install dependencies:
pip install -r requirements.txtIf Piper is not on your system PATH, set PIPER_COMMAND before starting the
app:
$env:PIPER_COMMAND = "C:\path\to\piper\piper.exe"Run the app:
python funky_talker.pyThen open:
http://127.0.0.1:5000
Build the image from the project root:
docker build -t funky-talker .Run the container and mount the local models/ directory:
docker run --rm -p 5000:5000 -v ${PWD}/models:/app/models funky-talkerThen open:
http://localhost:5000
On Windows PowerShell, ${PWD} should resolve to the current project folder. If
Docker has trouble with that path, use the full path instead:
docker run --rm -p 5000:5000 -v D:\personal\code\funky_talker\models:/app/models funky-talkerThe app creates a few local runtime files:
input.txtstatic/output.wav
These are generated output and should not be committed.
This project demonstrates:
- Python application structure
- Flask request/response handling
- Template rendering with Jinja
- Calling a local command-line AI/TTS tool from Python
- Managing local model assets outside git
- Docker image creation and container runtime usage
Possible next improvements:
- Move model definitions into a config file
- Add character or speaking-style presets
- Improve the visual design of the web interface
- Add a
compose.yamlfor a shorter Docker startup command - Add basic error handling when a model file is missing