diff --git a/README.md b/README.md index 9edd663..682a0cc 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,81 @@ -# Narrata - -Narrata reads PDFs, EPUBs, web pages and your own text aloud and highlights each word as it is spoken. The voice runs on your computer, in the browser. Nothing you read is uploaded, there is no account, and after a one-time download it works offline. + + + Narrata: a free, open-source read-aloud app. The voice runs in your browser and highlights each word as it reads. + + +

+ + + + Open Narrata + + +

+ +

+ Chrome extension · + Voices · + Privacy +

+ +**Narrata** reads PDFs, EPUBs, web pages and your own text aloud and highlights each word as it is spoken. The voice runs on your computer, in the browser: nothing you read is uploaded, there is no account, and after a one-time download it works offline. It is a free, open-source (MIT) alternative to Speechify, with a web app and a Chrome extension that reads the page you are on. ![Narrata reading a PDF aloud, with the spoken word highlighted on the page](docs/demo.gif) -It is free and open source (MIT). There is a web app and a Chrome extension that reads the page you are on. +

A PDF read aloud with the natural voice. The highlight follows the voice word by word.

+ +## Get started + +**Web app:** open [kernel-hunter.github.io/narrata](https://kernel-hunter.github.io/narrata/). Pick a voice, then try the sample, open a file or paste text. Nothing to install, though the browser can install it as an app. + +**Chrome extension:** not in the Chrome Web Store yet. [Load it from the source](#chrome-extension) in a few steps. + +
+Run it from the source + +Requires Node.js 22 or newer and pnpm. + +```sh +pnpm install +pnpm dev +``` + +Then open http://localhost:5330. See [Development](#development) for the other commands. -## What it does +
-- Opens PDFs (on the original page, or as reflowed text), EPUB books, saved web pages, Markdown and text files, or text you paste. -- Highlights the word being read and follows it down the page. Click any word to start from there. -- Speed from 0.5x to 3x. The pitch stays natural. -- 28 natural voices (American and British English) and 3 fast voices for older computers. -- Reading font, size and line spacing, including the OpenDyslexic font. Light and dark themes. -- Remembers where you stopped in every document. -- Exports a document as an audio file (.m4a, or .wav where the browser cannot encode AAC). -- Keyboard shortcuts, media keys and lock screen controls. Can be installed as an app. +## Features -## First run +- **Word highlighting.** The word being read is highlighted and the page follows it. Click any word to start from there. +- **PDFs, EPUBs and web pages.** PDFs (on the original page, or as reflowed text), EPUB books, saved web pages, Markdown and text files, or text you paste. +- **Voices that run on your device.** 28 natural voices (American and British English) and 3 fast voices for older computers. +- **Speed from 0.5x to 3x.** The pitch stays natural. +- **Reading settings.** Reading font, size and line spacing, including the OpenDyslexic font. Light and dark themes. +- **Remembers your place.** Every document opens where you stopped. +- **Audio export.** Saves a document as an audio file (.m4a, or .wav where the browser cannot encode AAC). +- **Keyboard and media keys.** Keyboard shortcuts, media keys and lock screen controls. Can be installed as an app. + +## How it compares + +Speechify's column comes from its [pricing page](https://speechify.com/pricing/), checked on 30 October 2026. + +| | Narrata | Speechify | +| --- | --- | --- | +| Price | Free | Free plan; Premium $139 a year or $29 a month | +| Voices | 28 natural and 3 fast, English only | Free: 10 "robotic sounding" voices. Premium: 1000+ natural voices, 60+ languages | +| Speed | Up to 3x | Up to 1.5x free, 5x Premium | +| Where it runs | Web app, Chrome extension (load unpacked for now) | iPhone, iPad, Android, Mac, Windows, web, Chrome and Edge extensions | +| AI summaries and chat | No | Premium | +| Source code | Open, MIT | Closed | + +Speechify covers far more languages and devices. Narrata reads English only and runs on a computer, but it is free and your documents stay on that computer. + +## Voices and licences Before anything is downloaded, Narrata asks which voice you want: +![The first-run voice choice: natural voice, 178 MB, or fast voice, 64 MB, with a speed test recommendation](docs/readme/voice-choice.png) + | | Natural voice | Fast voice | | --- | --- | --- | | Model | [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) | [Piper](https://github.com/rhasspy/piper) (Kristin, John, Cori) | @@ -32,12 +87,6 @@ It suggests one based on a quick look at your computer: the number of cores, the If the natural voice turns out to be too slow while reading, Narrata offers once to switch to the fast voice. -## Privacy - -Everything runs in your browser. The app downloads the voice you choose from Hugging Face the first time (and the other voice only if you pick it later). Apart from that it makes no network requests of its own: no analytics, no server, no account. Your documents, reading positions and settings stay in the browser's storage (IndexedDB, local storage and the Origin Private File System) and are never uploaded. Clearing the site data in your browser, or **Remove voice data** under More, About and storage, deletes them. - -## Voices and licences - | Voice | Licence | Notes | | --- | --- | --- | | Kokoro-82M, 28 English voices | Apache-2.0 | Run from the [ONNX export with word timestamps](https://huggingface.co/onnx-community/Kokoro-82M-v1.0-ONNX-timestamped), downloaded at runtime. | @@ -46,25 +95,16 @@ Everything runs in your browser. The app downloads the voice you choose from Hug Most other Piper voices are fine-tuned from the "lessac" voice, whose recordings are licensed for non-commercial research only, so they are not offered. Piper normally needs eSpeak NG (GPL) to turn text into phonemes; Narrata uses its own phonemizer (a TypeScript port of misaki), so no eSpeak code or data is included. Narrata itself is MIT; see [NOTICE](NOTICE) for everything it includes. -## Browser support - -What was checked for this release (30 October 2026, macOS 27 on an Apple M5 laptop), and how: - -| Browser | What was checked | Result | -| --- | --- | --- | -| Chrome for Testing 156 (Playwright) | Web app production build: natural voice on the processor, PDF page view with highlighting (the demo above), speed test calibration. Extension: the automated checks in `tests/e2e/verify-ext.mjs` and the first-run choice with a fresh profile. | Works. In the extension the natural voice ran on the graphics chip at 6.1x real time. | -| Chromium 152 (an Electron-based embedded browser) | Web app, development server and production build served from `/narrata/` by a server that sends no isolation headers: first-run choice, fast voice download and reading, switching to a natural voice (download while the fast voice reads), a simulated graphics chip failure, Remove voice data. | Works. The service worker made the page cross-origin isolated (4 threads); WebGPU was detected. | -| Safari 27 | Not tested: automating it needs a Safari setting changed. | Unknown. | -| Firefox, Edge, Chrome on Windows, Linux or Android | Not tested for this release. | Unknown. Edge uses the same engine as Chrome. | - -If you try one of the untested browsers, an issue saying whether it worked (and which voice and device the About dialog shows) helps. +## Privacy -Narrata needs WebAssembly with SIMD. Several processor threads need cross-origin isolation, which the app's service worker provides on any static host, so it is not something you need to configure. +Everything runs in your browser. The app downloads the voice you choose from Hugging Face the first time (and the other voice only if you pick it later). Apart from that it makes no network requests of its own: no analytics, no server, no account. Your documents, reading positions and settings stay in the browser's storage (IndexedDB, local storage and the Origin Private File System) and are never uploaded. Clearing the site data in your browser, or **Remove voice data** under More, About and storage, deletes them. ## Chrome extension The extension reads web pages where they are, highlights the word being spoken on the page and tints the sentence. It uses the same voices as the web app, running inside the extension. +![Reading an article with the extension: the current word and sentence are highlighted on the page, with the floating player in the corner](docs/screenshots/ext-reading.png) + It is not in the Chrome Web Store yet. To install it from the source: 1. Install [Node.js](https://nodejs.org/) 22 or newer and [pnpm](https://pnpm.io/installation). @@ -80,8 +120,6 @@ What it does: - The floating player has play and pause, previous and next sentence, speed and voice. Alt+Shift+P plays or pauses from anywhere. Shortcuts can be changed at `chrome://extensions/shortcuts`. - Chrome does not let extensions read its own pages, the Web Store, or PDFs in its built-in PDF viewer. For PDFs and EPUBs, use the web app. -![Reading an article with the extension](docs/screenshots/ext-reading.png) - | Permission | Why | | --- | --- | | `activeTab` | Read the page you are on, only after you click the button, use a shortcut or the right-click menu. | @@ -92,9 +130,37 @@ What it does: There are no host permissions. The extension's content security policy allows network connections only to Hugging Face, for the voice download. +## Browser support + +What was checked for this release (30 October 2026, macOS 27 on an Apple M5 laptop), and how: + +| Browser | Result | +| --- | --- | +| Chrome for Testing 156 (Playwright) | Works. In the extension the natural voice ran on the graphics chip at 6.1x real time. | +| Chromium 152 (an Electron-based embedded browser) | Works. The service worker made the page cross-origin isolated (4 threads); WebGPU was detected. | +| Safari 27 | Unknown. Not tested: automating it needs a Safari setting changed. | +| Firefox, Edge, Chrome on Windows, Linux or Android | Unknown. Not tested for this release. Edge uses the same engine as Chrome. | + +
+What was checked in each browser + +- **Chrome for Testing 156 (Playwright).** Web app production build: natural voice on the processor, PDF page view with highlighting (the demo above), speed test calibration. Extension: the automated checks in `tests/e2e/verify-ext.mjs` and the first-run choice with a fresh profile. +- **Chromium 152 (an Electron-based embedded browser).** Web app, development server and production build served from `/narrata/` by a server that sends no isolation headers: first-run choice, fast voice download and reading, switching to a natural voice (download while the fast voice reads), a simulated graphics chip failure, Remove voice data. + +
+ +If you try one of the untested browsers, an issue saying whether it worked (and which voice and device the About dialog shows) helps. + +Narrata needs WebAssembly with SIMD. Several processor threads need cross-origin isolation, which the app's service worker provides on any static host, so it is not something you need to configure. + ## Slower computers -How fast the natural voice runs depends on the computer. On an Apple M5 laptop it generates about 7 seconds of speech per second on the graphics chip, and 2 to 2.5 seconds per second on the processor with 4 threads. Measured with `scripts/bench/cpu-bench.mjs`, with the browser slowed down by the operating system to emulate slower computers, reading the three-paragraph sample (about a minute of speech) at 1x on the processor: +How fast the natural voice runs depends on the computer. On an Apple M5 laptop it generates about 7 seconds of speech per second on the graphics chip, and 2 to 2.5 seconds per second on the processor with 4 threads. Below about 1x real time the natural voice cannot keep up with playback however much audio is buffered, and that is where the fast voice helps. + +
+Measurements on emulated slower computers + +Measured with `scripts/bench/cpu-bench.mjs`, with the browser slowed down by the operating system to emulate slower computers, reading the three-paragraph sample (about a minute of speech) at 1x on the processor: | Emulated computer | Natural voice speed | Wait before audio | Pauses | Fast voice speed | | --- | --- | --- | --- | --- | @@ -104,7 +170,9 @@ How fast the natural voice runs depends on the computer. On an Apple M5 laptop i | 6 times slower | 0.34x | 10 s | 7 (111 s in all) | 3.7x | | 17 times slower | 0.12x | 15 s | 7 (401 s in all) | 1.2x | -Below about 1x real time the natural voice cannot keep up with playback however much audio is buffered, and that is where the fast voice helps. The emulation slows every core equally, so a real computer with more, slower cores may do better than the table suggests. +The emulation slows every core equally, so a real computer with more, slower cores may do better than the table suggests. + +
What the player does on a slow computer: @@ -131,15 +199,22 @@ pnpm dev # http://localhost:5330 pnpm test # unit tests (Vitest) pnpm typecheck # tsc --noEmit pnpm build # production build in dist/ -pnpm preview # serve dist/ on http://localhost:5331 -pnpm build:ext # browser extension in dist-ext/ -pnpm build:ext:test # extension with hooks for automated checks, in dist-ext-test/ -pnpm audit:licenses # licences of everything the builds contain; fails on GPL, LGPL or AGPL +pnpm preview # serve dist/ on :5331 +pnpm build:ext # extension in dist-ext/ +pnpm build:ext:test # extension with test hooks +pnpm audit:licenses # fails on GPL, LGPL or AGPL ``` +`pnpm build:ext:test` builds the extension with hooks for automated checks, in `dist-ext-test/`. `pnpm audit:licenses` checks the licences of everything the builds contain. + The production build uses relative paths, so `dist/` can be served from any path, such as `https://.github.io/narrata/`. `.github/workflows/pages.yml` builds it and deploys it to GitHub Pages; `.github/workflows/ci.yml` runs the tests, type check, both builds and the licence audit on every push and pull request. -Measurement scripts (macOS, Playwright's Chromium, `pnpm exec playwright install chromium` once): +The G2P data in `src/engine/g2p/data/` is generated by the scripts in `scripts/g2p/`; each one explains its inputs at the top. `pnpm dev` and `pnpm build` copy the ONNX Runtime and pdf.js runtime files into `public/`, so the app never loads code from a CDN. + +
+Measurement scripts + +macOS, Playwright's Chromium (`pnpm exec playwright install chromium` once): - `node scripts/bench/cpu-bench.mjs` measures the processor path under emulated slower computers: speed, time to first audio and pauses. Chrome's CPU throttling does not slow down Web Workers, so the script slows the browser's processes with the operating system instead. - `node scripts/bench/device-check.mjs` checks the first-run speed test against the measured speed of the natural voice at the same emulated speeds. @@ -147,21 +222,38 @@ Measurement scripts (macOS, Playwright's Chromium, `pnpm exec playwright install - `node scripts/bench/record-demo.mjs` records `docs/demo.gif` (needs ffmpeg). - `node tests/e2e/verify-ext.mjs` loads `dist-ext-test/` into Chromium and checks reading, highlighting, speed, controls, selections, frames and restricted pages. -The G2P data in `src/engine/g2p/data/` is generated by the scripts in `scripts/g2p/`; each one explains its inputs at the top. `pnpm dev` and `pnpm build` copy the ONNX Runtime and pdf.js runtime files into `public/`, so the app never loads code from a CDN. +
+ +
+Project layout ``` -src/core/ text model, sentence splitting and chunking, word alignment, timing, device decisions -src/docs/ readers for text, Markdown, HTML, EPUB and PDF -src/engine/ TTS worker, model storage (OPFS), device check, text to phonemes (g2p/), voices, Piper, export -src/audio/ playback engine and audio cache -src/ui/ reading views, player bar, menus and dialogs -src/store/ library (IndexedDB) and settings -src/pwa/ service worker and registration -extension/ browser extension: manifest, service worker, offscreen document, content script, popup -tests/ unit tests, fixtures and extension checks +src/core/ text model, sentence splitting + and chunking, word alignment, + timing, device decisions +src/docs/ readers for text, Markdown, + HTML, EPUB and PDF +src/engine/ TTS worker, model storage + (OPFS), device check, text to + phonemes (g2p/), voices, Piper, + export +src/audio/ playback engine and audio cache +src/ui/ reading views, player bar, + menus and dialogs +src/store/ library (IndexedDB) and settings +src/pwa/ service worker and registration +extension/ browser extension: manifest, + service worker, offscreen + document, content script, popup +tests/ unit tests, fixtures and + extension checks ``` -See [CONTRIBUTING.md](CONTRIBUTING.md) to send a change and [SECURITY.md](SECURITY.md) to report a security problem. +
+ +## Contributing + +Bug reports, fixes and small improvements are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) to send a change and [SECURITY.md](SECURITY.md) to report a security problem. ## Credits diff --git a/docs/launch.md b/docs/launch.md index a14ad03..096aea9 100644 --- a/docs/launch.md +++ b/docs/launch.md @@ -1,6 +1,6 @@ # Launch drafts -Drafts for announcing Narrata. Nothing here has been posted. Where a draft needs a personal reason for building it, there is a note in brackets: write that part yourself, in your own words, rather than posting a made-up motivation. Replace `` with the GitHub Pages address and `` with the repository link once they exist. Numbers come from the README and the benchmarks in `scripts/bench/`; check them again before posting if the code changed. +Drafts for announcing Narrata. Nothing here has been posted. Where a draft needs a personal reason for building it, there is a note in brackets: write that part yourself, in your own words, rather than posting a made-up motivation. Numbers come from the README and the benchmarks in `scripts/bench/`; check them again before posting if the code changed. ## Show HN @@ -24,10 +24,10 @@ Text: > > There is also a Chrome extension that reads the page you are on and highlights it in place. It is not in the Web Store yet; it can be loaded unpacked from the repository. > -> Known limits: English only for now. Chrome and Edge are what I tested most; Safari and Firefox are listed in the README with what I checked. On older laptops the natural voice may pause, which is what the fast voice is for. +> Known limits: English only for now. I tested it in Chrome and Chromium; the README lists each browser and what I checked. Safari, Firefox and Edge are untested so far. On older laptops the natural voice may pause, which is what the fast voice is for. > -> App: -> Code: +> App: https://kernel-hunter.github.io/narrata/ +> Code: https://github.com/Kernel-Hunter/narrata ## X (each post 280 characters or fewer; X counts a link as 23) @@ -35,7 +35,7 @@ Main post (242 characters with the link): > Narrata reads PDFs, EPUBs and web pages aloud and highlights each word. The voice model runs in your browser, so nothing you read leaves your computer. Free, open source (MIT), works offline after a one-time download. > -> +> https://kernel-hunter.github.io/narrata/ Follow-up (229 characters): @@ -45,13 +45,13 @@ Follow-up (181 characters with the link): > There is also a Chrome extension that reads the page you are on and highlights the words in place. Not in the Web Store yet; load it unpacked from the repo. > -> +> https://github.com/Kernel-Hunter/narrata ## Bluesky (300 characters max) > Narrata reads PDFs, EPUBs and web pages aloud with word-by-word highlighting. The voice model runs in your browser: no server, no account, nothing uploaded. Works offline after a one-time download. MIT licensed. > -> +> https://kernel-hunter.github.io/narrata/ Follow-up: @@ -79,9 +79,9 @@ Text: > - Does it read your kind of documents well (school PDFs, scanned pages, ebooks)? > - What is missing compared to what you use now? > -> It works best in Chrome or Edge on a computer. The first time, it downloads a voice (64 or 178 MB) and then works offline. +> It is tested in Chrome on a computer. The first time, it downloads a voice (64 or 178 MB) and then works offline. > -> +> https://kernel-hunter.github.io/narrata/ ### r/ADHD @@ -97,11 +97,11 @@ Text: > > [One sentence on why you built it, if it is true for you.] Narrata reads PDFs, EPUBs, web pages and pasted text, highlights the current word, and lets you speed it up to 3x without the chipmunk voice. It remembers where you stopped in each document. > -> The voice runs on your computer, so nothing you read is uploaded. It works best in Chrome or Edge on a laptop or desktop. +> The voice runs on your computer, so nothing you read is uploaded. It is tested in Chrome on a laptop or desktop. > > If you try it, I would like to hear what gets in the way: too many settings, the voice, the speed, anything. > -> +> https://kernel-hunter.github.io/narrata/ ### r/students @@ -119,7 +119,7 @@ Text: > > Feedback on what breaks with your course PDFs is the most useful thing for me right now. > -> +> https://kernel-hunter.github.io/narrata/ ## Product Hunt @@ -172,7 +172,7 @@ Long description: > Limits > English only. Chrome does not let extensions read its own pages, the Web Store, or PDFs in its built-in viewer; for PDFs and ebooks, use the Narrata web app. > -> Narrata is free and open source under the MIT License: +> Narrata is free and open source under the MIT License: https://github.com/Kernel-Hunter/narrata ### Privacy practices tab @@ -205,4 +205,4 @@ Certifications (all three apply): - I do not use or transfer user data for purposes that are unrelated to my item's single purpose. - I do not use or transfer user data to determine creditworthiness or for lending purposes. -Privacy policy URL: the store requires one even when no data is collected. Point it at the Privacy section of the README (`#privacy`) or publish a short page that says the same. +Privacy policy URL: the store requires one even when no data is collected. Point it at the Privacy section of the README (https://github.com/Kernel-Hunter/narrata#privacy) or publish a short page that says the same. diff --git a/docs/readme/narrata-banner-dark.png b/docs/readme/narrata-banner-dark.png new file mode 100644 index 0000000..bbd4411 Binary files /dev/null and b/docs/readme/narrata-banner-dark.png differ diff --git a/docs/readme/narrata-banner-light.png b/docs/readme/narrata-banner-light.png new file mode 100644 index 0000000..74ca6f2 Binary files /dev/null and b/docs/readme/narrata-banner-light.png differ diff --git a/docs/readme/open-narrata-dark.png b/docs/readme/open-narrata-dark.png new file mode 100644 index 0000000..c872629 Binary files /dev/null and b/docs/readme/open-narrata-dark.png differ diff --git a/docs/readme/open-narrata-light.png b/docs/readme/open-narrata-light.png new file mode 100644 index 0000000..fb3f33d Binary files /dev/null and b/docs/readme/open-narrata-light.png differ diff --git a/docs/readme/voice-choice.png b/docs/readme/voice-choice.png new file mode 100644 index 0000000..6070c73 Binary files /dev/null and b/docs/readme/voice-choice.png differ