Mytrya
Start a project

Case file · Own product · 2026

Narrately

Your own books read aloud, with the text in view, narrated on demand and kept for offline listening.

Narrately turns a reader's own EPUB, PDF or TXT into an audiobook they listen to with the text on screen. It rebuilds chapters from the file, leaves out the contents pages, copyright and previews of other books, detects the language from the text itself, and narrates a segment at a time just ahead of the listener, so playback starts in about a second and nothing is paid for until someone listens. Audio is cached by the text it speaks, so identical text in the same voice is narrated once for every reader. The spoken sentence is highlighted, books download for offline listening, and readers pay for monthly narration hours with eSewa.

Status
Live · invite-only
Changes, 30 days
31
Written by
Suraj Malla
Updated
Stack
Next.js 16 · Clerk · Upstash Redis · Cloudflare R2 · Kokoro + Gemini TTS · eSewa

Facts

Input
EPUB (including EPUB 2 tables of contents), PDF, TXT; non-Latin scripts such as Devanagari
Voices
Kokoro-82M for English, Gemini Flash Lite TTS for other languages; CosyVoice2, Fish Audio, OpenAI and ElevenLabs switchable by the admin
Storage
Book text, covers and audio in Cloudflare R2; lists, progress, usage and settings in Upstash Redis
Reading
Sentence highlight, focus mode, bold word starts, Lexend easy-read type, light, sepia and dark themes
Offline
Text, cover and audio in the browser's Cache Storage; a service worker keeps Downloads working; installable
Plans
Free, Plus and Pro in hours of narration a month, bought for 1, 3 or 12 months through eSewa
Admin
Overview with hours narrated and cost, activity log, readers, narration settings, payments

The problem

Most books people already own will never get an audiobook, and almost none in Nepali. Generic text-to-speech apps read a file from top to bottom, including the copyright page, the table of contents and the five-page preview of the author's next book.

Narrating a whole book up front costs money for chapters that may never be played. Narrating in one long request means waiting minutes before the first word.

How it works

  EPUB · PDF · TXT ──▶ R2 (browser uploads direct, presigned)
                             │
                             ▼
             parse ──▶ chapters    PDF: lines from glyph positions,
               │                   repeated headers and footers dropped
               ▼
             clean ──▶ skip contents, copyright, praise, previews…
               │       (listed for the reader, not hidden)
               ▼
           language ──▶ from the text: script, then common words
               │
               ▼
           segments    first ≤280 chars, then ≤900, sentence-safe
                             │
  player ── current + next two ──▶ audio/<engine>/<voice>/<sha256>.mp3
                                         │
                            hit: free ◀──┴──▶ miss: narrate, 32 kbps,
                                               count against the plan
  download ──▶ Cache Storage + service worker ──▶ listens with no signal
Data flow, as built
  • Importers for EPUB, PDF and TXT. EPUB chapters come from the book's own table of contents, EPUB 2 included. PDFs have no chapters or paragraphs, so lines are rebuilt from text positions, running headers, page numbers and watermarks are removed as lines that repeat across pages, paragraphs are rebuilt from indentation and gaps, and chapters come from the PDF's bookmarks or from headings on a line of their own.
  • One cleaning pass for every format: contents, copyright, praise, dedications, acknowledgments, newsletter pages and previews of other books are skipped, tiny title-only sections such as Part One are folded into the chapter after them, and the reader can see what was left out and why. The original file is kept so a book can be re-processed when the importer improves.
  • A player that narrates the current segment and prepares the next two, with a sleep timer, lock-screen and headphone controls, progress saved while playing and when the page is hidden, and the audio element claimed inside the first tap because iOS only allows playback that starts there.
  • Read-along: the current segment is highlighted and the sentence being spoken is estimated from how far through the segment the voice is, weighted by sentence length. The page follows the voice in calm steps, stops following when the reader scrolls away, and offers a way back.
  • Offline downloads in batches, with a progress ring in the header, a confirmation before a download is removed, and unfinished downloads shown as unfinished.
  • Invite-only access and suspension enforced by the app, a recently-deleted shelf that keeps books for 30 days, and an admin area with readers, books, hours narrated, estimated cost, daily usage, an activity log and the narration settings.
  • Plans paid through eSewa: the phone path opens the eSewa app through a deeplink, the desktop path posts a signed form to eSewa's payment page.

Decisions that mattered

5

Narrate on demand, and only once

Audio is stored under the engine, the voice and a hash of the text it speaks. Any reader who plays identical text in the same voice gets the existing file. Replays and cache hits are free and don't count against anyone's allowance; only newly narrated characters do.

Nothing is narrated until someone presses play, so a book abandoned after chapter two costs two chapters. Playback and prefetch can ask for the same segment at the same moment, so one generation is shared between them.

The first segment is short so the voice starts in about a second

A chapter is cut into segments of up to about 900 characters on sentence boundaries, but the first one is at most 280. Generating 280 characters is quick, and by the time it finishes playing the next two segments are ready. One segment is one request, one file and one highlight, which also keeps the highlight close to the voice.

A book's language comes from its text, not its metadata

Conversion tools stamp "en" on books whatever their language, so the declared language is ignored. The text is checked for scripts used by one language first. Nepali, Hindi and Marathi share Devanagari, so they're told apart by their most common small words, and Latin-script languages get the same treatment.

The language decides which voices are offered and which allowance the narration counts against. Sentences end at । and ॥ as well as full stops, and bold word starts are switched off for scripts where cutting a word in two breaks its letters apart.

Plans priced against the heaviest reader

eSewa can't charge automatically, so paid plans are bought for 1, 3 or 12 months and fall back to Free when they run out. English narration on Kokoro costs about $0.62 per million characters; other languages on Gemini cost many times more, so Free covers English only.

Every paid plan is checked to stay profitable for a reader who uses all of it on the cheapest period, at double today's Gemini prices, and the admin's narration page shows the margins for whichever engines are selected.

Nothing eSewa sends to the browser or to the callback URL is trusted on its own. Every change in a payment's status comes from asking eSewa's status API server to server.

Small files for phones

Narration is stored at 32 kbps, clear for speech and half the size of 64. At that bitrate the MP3 encoder works at a lower sample rate, and its built-in resampler output silence, so the audio is resampled first with a low-pass filter so nothing aliases.

Providers return audio in parts, each with a header stating the length of that part only. Left in, players show a duration of a few seconds and seeking breaks, so only the real audio frames are kept and one header is written for the whole file.

What isn’t shown

My own product, live at narrately.mytrya.com. Access is by invitation, so the link lands on the sign-in page. Readers upload their own files, and each book stays private to the reader who uploaded it. Prices per character are the engines' list prices as of October 2026.

Taking new projects · start within 2 weeks

Have a system like this in mind?

What it is, who does it, how often, and what goes wrong when it’s late. I reply within one working daywith a scoping call or an honest reason it isn’t worth automating.

Start a project [email protected]

First projects from $3,000 · fixed price