cd /news/ai-tools/how-to-convert-an-epub-to-an-m4b-aud… · home › topics › ai-tools › article
[ARTICLE · art-168753] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

How to Convert an EPUB to an M4B Audiobook in a Cloned Voice (No GPU, Open Source)

An open-source command-line tool, miragea-audiobook, converts EPUB, Markdown and plain-text files into a single chaptered .m4b audiobook narrated through the Miragea API in a voice cloned from a short sample, without requiring a GPU or local model weights. The tool splits text into whole-sentence chunks of about 900 characters, voices them in parallel and caches results by request hash so interrupted runs resume without re-billing, and it emits chapter markers, a .cue sheet, a chapters list, a JSON manifest and per-chapter MP3s. The developer reports running chapter 1 back through speech recognition and finding it matched the source text word for word.

by read1 min views2 publishedNov 13, 2026

If you have searched for "EPUB to audiobook" you have probably met tools that want PyTorch, a few gigabytes of model weights and a GPU. This tutorial does the same job from a plain command line: miragea-audiobook reads an EPUB, Markdown or text file, narrates it through the Miragea API in a voice cloned from a short sample, and gives you one chaptered .m4b.

brew install ffmpeg or apt install ffmpeg)

pipx install miragea-audiobook
export MIRAGEA_API_KEY=...
miragea-audiobook chapters book.epub
miragea-audiobook plan book.epub

EPUB chapters come from the spine and each file's first heading. Covers and copyright stubs under 20 words are skipped. For Markdown, each ## heading is a chapter; for plain text, lines starting with "Chapter", "Part", "Prologue" and similar.

miragea-audiobook make book.epub \
  --voice 'https://example.com/my-voice.wav|Exact words spoken in that sample.' --split

The text is cut into whole-sentence chunks (900 characters by default), voiced in parallel, and cached by request hash. If something fails halfway, run the same command again: finished chunks are reused and not billed twice.

the-salt-road.m4b with chapter markers, a .cue sheet, a .chapters.txt list ready for YouTube descriptions, a JSON manifest and one MP3 per chapter. Here is the real waveform of the demo book, with the markers at the chapter starts:

Listen to the real demo: https://codeberg.org/miragea-voice/miragea-audiobook/raw/branch/main/examples/demo/the-salt-road.m4b

I ran chapter 1 back through speech recognition and it matched the source text word for word.

--preview first on a big book: it builds the whole file offline with placeholder tones so you can check chapters and timing for free.--chapters 1-3 voices just a few chapters while you audition a voice. Source (MIT): https://codeberg.org/miragea-voice/miragea-audiobook. Package: https://pypi.org/project/miragea-audiobook/

── more in #ai-tools 4 stories · sorted by recency
── more on @miragea-audiobook 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-convert-an-ep…] indexed:0 read:1min 2026-11-13 · —