Single port (TTS_PORT) handles both the WS upgrade handshake and
connections. Adds job queue, generation worker, playback events
(queued/started/finished/aborted/error), and abort_current/abort_all
commands. Fixes BrokenPipeError when pacat is killed mid-write.
Updates all examples to use WebSocket; adds abort-demo.mjs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sends {"status": "ok"} before shutting down so the caller gets a clean
response. Shutdown runs in a daemon thread to avoid deadlocking the
handler. Adds examples/terminate.mjs as a Node.js usage example.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace stdin/stdout JSON line protocol with a stdlib HTTP server
(ThreadingHTTPServer). Three endpoints: POST /speak, /chime, /preload.
All return {"status": "ok"} after audio is queued for playback.
TTS generation is serialized via a threading.Lock; concurrent chime/preload
requests are handled without waiting for generation.
Add examples/speak.mjs, chime.mjs, voice-clone.mjs using Node.js built-in
fetch (no libraries required, Node 18+).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>