@polytts/node
v0.1.2
Published
Node entrypoint for polytts text-to-speech runtimes.
Downloads
347
Maintainers
Readme
@polytts/node
Node entrypoint for polytts.
Use this package for Node runtimes such as Electron main or preload code, Raycast extensions, and server-side synthesis workflows.
Install
npm install @polytts/nodeUsage
import { createNodeTTS } from "@polytts/node";
const tts = createNodeTTS();
await tts.ready();
await tts.writeWav("./hello.wav", "Hello from Node.");For progressive synthesis:
for await (const chunk of tts.synthesizeStream("Hello from a streaming Node runtime.")) {
console.log(chunk.sampleRate, chunk.channels[0]?.length ?? 0);
}The high-level API also exposes:
install(modelId?, onProgress?)uninstall(modelId?)getInstallState(modelId?)isInstalled(modelId?)
@polytts/node intentionally does not expose speak(). In Node hosts, playback is application-specific, so the package focuses on synthesis and file/byte output (synthesize(), synthesizeToWav(), writeWav()).
Built-in models
- Kokoro 82M
- Piper voice bundles
- KittenTTS Mini and Nano
- Supertonic 2
Browser Speech is intentionally browser-only and is not part of this package.
