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. 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 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 https://codeberg.org/miragea-voice/miragea-audiobook . Package: https://pypi.org/project/miragea-audiobook/ https://pypi.org/project/miragea-audiobook/