Skip to content

Converts an epub to a directory of mp3s using piper-tts

License

Notifications You must be signed in to change notification settings

thillsd/piperbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiperBook

Converts an epub to a directory of mp3s using piper-tts.

$ piperbook -s 1.0 -p 0.5 -v "en_US-ryan-high" test.epub author/test
19:55:27	MainThread	Chapters count: 5.
19:55:27	MainThread	Converting chapters 1 to 5.
19:55:35	worker-0	[✓] Wrote file 1_test_epub.mp3
19:55:39	worker-1	[✓] Wrote file 2_test_epub.mp3
19:58:12	worker-1	[✓] Wrote file 3_test_epub.mp3
19:59:27	worker-0	[✓] Wrote file 4_test_epub.mp3
20:00:54	worker-1	[✓] Wrote file 5_test_epub.mp3
20:00:56	MainThread	Cleaned up 0 from cache.

Supports voices models as listed on the piper Readme

Usage

usage: piperbook [-h] [--start START] [--end END] [-s SPEED] [-v VOICE] [-p PAUSE] [-c] [-j PROCESSES] epub audiobook-folder

Convert epub file to audiobook directory of mp3s

positional arguments:
  epub                  Epub file
  audiobook-folder      Destination folder for the mp3 files

options:
  -h, --help            show this help message and exit
  --start START         chapter to start from [default: 1]
  --end END             chapter to finish at [default: -1]
  -s SPEED, --speed SPEED
                        speed of the generated audio (lower is faster!) [default: 1.0]
  -v VOICE, --voice VOICE
                        voice to use for the generated audio. To see valid options, see the docs for piper [default: en_US-ryan-high]
  -p PAUSE, --pause PAUSE
                        length of pauses between sentences [default: 0.5]
  -c, --clobber         overwrite existing files [default: False]
  -j PROCESSES, --processes PROCESSES
                        number of piper processes to use. Keep this value low--piper is threaded already. [default: 2]

Installation

Tested on Debian 12.

$ apt install python python-pip ffmpeg
$ pip install piperbook
$ piperbook --help

Bugs

Chapter detection and naming is very imperfect. Patches welcome.

FAQ

I want m4b support

Either use m4btool or submit a patch.

Credit

Epub chapterising logic stolen from epub_to_audiobook.

About

Converts an epub to a directory of mp3s using piper-tts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages