Skip to content
/ tts Public

Repository files navigation

TTS

A text-to-speech reader built on the browser's native Web Speech API. Paste text, pick a voice, and it reads aloud sentence-by-sentence while highlighting the current word and auto-scrolling. Everything runs client-side — no server, no network calls, no data leaves the page.

Built with Svelte 5 + Vite, TypeScript throughout.

Features

  • Word-level highlighting synced to speech via boundary events
  • Click any word to start reading from there
  • Adjustable voice, rate, pitch, and volume
  • Auto-scroll that steps aside as soon as you scroll manually
  • Settings and input text persist across reloads (localStorage)
  • Keyboard shortcuts: Space play/pause, Esc stop
  • Graceful message on browsers without Web Speech support
  • Keep-alive workaround for Chrome's ~15s speech cutoff

Development

npm install
npm run dev        # start the dev server
npm run build      # type-check + production build to dist/
npm run preview    # preview the production build
npm run check      # svelte-check (type checking)
npm test           # run unit tests
npm run lint       # eslint + prettier check
npm run format     # apply prettier formatting

Notes & browser support

  • Requires a browser that implements the Web Speech API (recent Chrome, Edge, and Safari). Firefox support varies by platform and installed voices.
  • The voice picker prefers local (on-device) voices, because boundary events — which drive the highlighter — are unreliable or absent for remote/network voices. If no local voices are available, all voices are shown as a fallback.
  • Voice availability differs by OS and browser; the list is populated from whatever the platform exposes.

Similar tools

About

A text-to-speech reader built on the browser's native Web Speech API

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages