Uses piper-tts to convert epub files to audiobooks
Project description
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.
TODO
- m4b format support.
- Use piper more intelligently
Credit
Epub chapterising logic stolen from epub_to_audiobook.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
piperbook-2023.9.24.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for piperbook-2023.9.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 906ff52757222570a89c40feb9f79b46629376c6a36acd108e2e5c5b12f6d9db |
|
MD5 | 13061b87585522f7032c77142e882fe1 |
|
BLAKE2b-256 | 79f16129ce349d2ab803022c65d2b281e91cb761f0f74b0d41ad87c09c1a62ec |