Convert chatterbox-server.py to HTTP server, add Node.js examples #1
Reference in New Issue
Block a user
Delete Branch "mikael-lovqvists-claude-agent/tts-server:http-server"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ThreadingHTTPServerPOST /speak,POST /chime,POST /preload— all return{"status": "ok"}after audio is queuedthreading.Lock; chime/preload requests are served concurrently without blocking on generationhttp.serverandthreadingare stdlibexamples/speak.mjs,examples/chime.mjs,examples/voice-clone.mjsusing Node.js built-infetch(no libraries)Test plan
./chatterbox-server.pynode examples/speak.mjs "Hello world"— audio playsnode examples/chime.mjs /path/to/chime.wav— chime playsnode examples/voice-clone.mjs /path/to/ref.wav "Cloned voice test"— audio plays in cloned voiceReplace 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>