A small local HTTP server that speaks text through the computer's speakers using
Piper and the included en_GB-alan-medium voice. It works offline after Nix has
built the package.
Start it:
nix run path:.Port 5000 is used by default. To choose another port:
nix run path:. -- --port 5001The bundled Alan voice is used by default. To use another Piper model:
nix run path:. -- --model /absolute/path/to/voice.onnxBoth options can be combined:
nix run path:. -- --port 5001 --model /absolute/path/to/voice.onnxSpeak some text from another terminal:
curl -X POST http://127.0.0.1:5000/tts \
-H 'Content-Type: application/json' \
-d '{"text":"Hello from local text to speech."}'The endpoint generates a temporary WAV, plays it with pw-play, then deletes it.