// Speak text via the Chatterbox TTS server. // Usage: node speak.mjs "Hello world" const PORT = process.env.TTS_PORT ?? '11500' const text = process.argv[2] ?? 'Hello from Node.' const res = await fetch(`http://localhost:${PORT}/speak`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text }), }) const data = await res.json() if (data.status !== 'ok') { console.error('error:', data.message) process.exit(1) }