polytts
v0.1.2
Published
Default browser-first entrypoint for polytts text-to-speech runtimes.
Downloads
530
Maintainers
Readme
polytts
Default browser-first entrypoint for polytts.
Use this package if you want the simplest install and import path for browser apps, PWAs, or Electron renderers.
Install
npm install polyttsUsage
import { createBrowserTTS } from "polytts";
const tts = createBrowserTTS({
initialModelId: "browser-speech",
});
await tts.ready();
await tts.speak("Hello from polytts.");Behavior notes
initialModelIdselects the starting model, but it does not eagerly download or load it.download(modelId)caches assets.ready(),selectModel(), andspeak()prepare the model for actual playback.- Some models, such as Kokoro, may not expose their final resolved voice list until they are prepared.
- Piper uses a safer main-thread ONNX path on iOS, so stop/cancel is not as immediate there as it is for worker-backed models.
Exports
createBrowserTTS()createBrowserTTSRuntime()- official browser adapters
- official browser and Node catalogs from
@polytts/presets
For the explicit scoped browser package, use @polytts/browser.
