bookvox 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bookvox-0.5.0/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Claudio Santini
4
+ Copyright (c) 2026 Joseph
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
bookvox-0.5.0/PKG-INFO ADDED
@@ -0,0 +1,215 @@
1
+ Metadata-Version: 2.4
2
+ Name: bookvox
3
+ Version: 0.5.0
4
+ Summary: Generate audiobooks from e-books (epub to wav/m4b)
5
+ License: MIT License
6
+
7
+ Copyright (c) 2025 Claudio Santini
8
+ Copyright (c) 2026 Joseph
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ License-File: LICENSE
28
+ Author: Joseph
29
+ Author-email: jkhassan95@gmail.com
30
+ Maintainer: Joseph
31
+ Maintainer-email: jkhassan95@gmail.com
32
+ Requires-Python: >=3.10,<3.13
33
+ Classifier: License :: Other/Proprietary License
34
+ Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3.10
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Requires-Dist: bs4 (>=0.0.2,<0.0.3)
39
+ Requires-Dist: ebooklib (>=0.18,<0.19)
40
+ Requires-Dist: epub-toc (>=1.0.0,<2.0.0)
41
+ Requires-Dist: kokoro (==0.9.4)
42
+ Requires-Dist: misaki[zh] (>=0.9.2)
43
+ Requires-Dist: pick (>=2.4.0,<3.0.0)
44
+ Requires-Dist: qwen-tts (>=0.1.1,<0.2.0)
45
+ Requires-Dist: soundfile (>=0.13.1,<0.14.0)
46
+ Requires-Dist: spacy (>=3.8.3,<4.0.0)
47
+ Requires-Dist: tabulate (>=0.9.0,<0.10.0)
48
+ Project-URL: Issues, https://github.com/JHCodeQuest/bookvox/issues
49
+ Project-URL: Repository, https://github.com/JHCodeQuest/bookvox
50
+ Project-URL: Upstream project, https://github.com/santinic/audiblez
51
+ Description-Content-Type: text/markdown
52
+
53
+ # Bookvox: Generate audiobooks from e-books
54
+
55
+ [![Installing via pip and running](https://github.com/JHCodeQuest/bookvox/actions/workflows/pip-install.yaml/badge.svg)](https://github.com/JHCodeQuest/bookvox/actions/workflows/pip-install.yaml)
56
+ [![Git clone and run](https://github.com/JHCodeQuest/bookvox/actions/workflows/git-clone-and-run.yml/badge.svg)](https://github.com/JHCodeQuest/bookvox/actions/workflows/git-clone-and-run.yml)
57
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/bookvox)
58
+ ![PyPI - Version](https://img.shields.io/pypi/v/bookvox)
59
+
60
+ > **Bookvox is a maintained fork of [audiblez](https://github.com/santinic/audiblez) by [Claudio Santini](https://claudio.uk),**
61
+ > picking up from v0.4.9 after upstream development stopped in early 2026.
62
+ > All original work is his and remains under the MIT licence; see [`LICENSE`](./LICENSE).
63
+ > This fork exists to fix outstanding bugs, restore support for current Python versions,
64
+ > and land community contributions that were left open upstream.
65
+
66
+ ### v4 Now with Graphical interface, CUDA support, and many languages!
67
+
68
+ ![Bookvox GUI on MacOSX](./imgs/mac.png)
69
+
70
+ Bookvox generates `.m4b` audiobooks from regular `.epub` e-books,
71
+ using Kokoro's high-quality speech synthesis.
72
+
73
+ [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) is a recently published text-to-speech model with just 82M params and very natural sounding output.
74
+ It's released under Apache licence and it was trained on < 100 hours of audio.
75
+ It currently supports these languages: 🇺🇸 🇬🇧 🇪🇸 🇫🇷 🇮🇳 🇮🇹 🇯🇵 🇧🇷 🇨🇳
76
+
77
+ On a Google Colab's T4 GPU via Cuda, **it takes about 5 minutes to convert "Animal's Farm" by Orwell** (which is about 160,000 characters) to audiobook, at a rate of about 600 characters per second.
78
+
79
+ On my M2 MacBook Pro, on CPU, it takes about 1 hour, at a rate of about 60 characters per second.
80
+
81
+
82
+ ## How to install the Command Line tool
83
+
84
+ If you have Python 3 on your computer, you can install it with pip.
85
+ You also need `espeak-ng` and `ffmpeg` installed on your machine:
86
+
87
+ ```bash
88
+ sudo apt install ffmpeg espeak-ng # on Ubuntu/Debian 🐧
89
+ pip install bookvox
90
+ ```
91
+
92
+ ```bash
93
+ brew install ffmpeg espeak-ng # on Mac 🍏
94
+ pip install bookvox
95
+ ```
96
+
97
+ Then you can convert an .epub directly with:
98
+
99
+ ```
100
+ bookvox book.epub -v af_sky
101
+ ```
102
+
103
+ It will first create a bunch of `book_chapter_1.wav`, `book_chapter_2.wav`, etc. files in the same directory,
104
+ and at the end it will produce a `book.m4b` file with the whole book you can listen with VLC or any
105
+ audiobook player.
106
+ It will only produce the `.m4b` file if you have `ffmpeg` installed on your machine.
107
+
108
+ ## How to run the GUI
109
+
110
+ The GUI is a simple graphical interface to use bookvox.
111
+ You need some extra dependencies to run the GUI:
112
+
113
+ ```
114
+ sudo apt install ffmpeg espeak-ng
115
+ sudo apt install libgtk-3-dev # just for Ubuntu/Debian 🐧, Windows/Mac don't need this
116
+
117
+ pip install bookvox pillow wxpython
118
+ ```
119
+
120
+ Then you can run the GUI with:
121
+ ```
122
+ bookvox-ui
123
+ ```
124
+
125
+ ## How to run on Windows
126
+
127
+ After many trials, on Windows we recommend to install bookvox in a Python venv:
128
+
129
+ 1. Open a Windows terminal
130
+ 2. Create anew folder: `mkdir bookvox`
131
+ 3. Enter the folder: `cd bookvox`
132
+ 4. Create a venv: `python -m venv venv`
133
+ 5. Activate the venv: `.\venv\Scripts\Activate.ps1`
134
+ 6. Install the dependencies: `pip install bookvox pillow wxpython`
135
+ 7. Now you can run `bookvox` or `bookvox-ui`
136
+ 8. For Cuda support, you need to install Pytorch accordingly: https://pytorch.org/get-started/locally/
137
+
138
+
139
+ ## Speed
140
+
141
+ By default the audio is generated using a normal speed, but you can make it up to twice slower or faster by specifying a speed argument between 0.5 to 2.0:
142
+
143
+ ```
144
+ bookvox book.epub -v af_sky -s 1.5
145
+ ```
146
+
147
+ ## Supported Voices
148
+
149
+ Use `-v` option to specify the voice to use. Available voices are listed here.
150
+ The first letter is the language code and the second is the gender of the speaker e.g. `im_nicola` is an italian male voice.
151
+
152
+ [For hearing samples of Kokoro-82M voices, go here](https://claudio.uk/posts/audiblez-v4.html)
153
+
154
+ | Language | Voices |
155
+ |---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
156
+ | 🇺🇸 American English | `af_alloy`, `af_aoede`, `af_bella`, `af_heart`, `af_jessica`, `af_kore`, `af_nicole`, `af_nova`, `af_river`, `af_sarah`, `af_sky`, `am_adam`, `am_echo`, `am_eric`, `am_fenrir`, `am_liam`, `am_michael`, `am_onyx`, `am_puck`, `am_santa` |
157
+ | 🇬🇧 British English | `bf_alice`, `bf_emma`, `bf_isabella`, `bf_lily`, `bm_daniel`, `bm_fable`, `bm_george`, `bm_lewis` |
158
+ | 🇪🇸 Spanish | `ef_dora`, `em_alex`, `em_santa` |
159
+ | 🇫🇷 French | `ff_siwis` |
160
+ | 🇮🇳 Hindi | `hf_alpha`, `hf_beta`, `hm_omega`, `hm_psi` |
161
+ | 🇮🇹 Italian | `if_sara`, `im_nicola` |
162
+ | 🇯🇵 Japanese | `jf_alpha`, `jf_gongitsune`, `jf_nezumi`, `jf_tebukuro`, `jm_kumo` |
163
+ | 🇧🇷 Brazilian Portuguese | `pf_dora`, `pm_alex`, `pm_santa` |
164
+ | 🇨🇳 Mandarin Chinese | `zf_xiaobei`, `zf_xiaoni`, `zf_xiaoxiao`, `zf_xiaoyi`, `zm_yunjian`, `zm_yunxi`, `zm_yunxia`, `zm_yunyang` |
165
+
166
+ For more detaila about voice quality, check this document: [Kokoro-82M voices](https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md)
167
+
168
+ ## How to run on GPU
169
+
170
+ By default, bookvox runs on CPU. If you pass the option `--cuda` it will try to use the Cuda device via Torch.
171
+
172
+ Check out this example: [Bookvox running on a Google Colab Notebook with Cuda ](https://colab.research.google.com/drive/164PQLowogprWQpRjKk33e-8IORAvqXKI?usp=sharing]).
173
+
174
+ We don't currently support Apple Silicon, as there is not yet a Kokoro implementation in MLX. As soon as it will be available, we will support it.
175
+
176
+ ## Manually pick chapters to convert
177
+
178
+ Sometimes you want to manually select which chapters/sections in the e-book to read out loud.
179
+ To do so, you can use `--pick` to interactively choose the chapters to convert (without running the GUI).
180
+
181
+
182
+ ## Help page
183
+
184
+ For all the options available, you can check the help page `bookvox --help`:
185
+
186
+ ```
187
+ usage: bookvox [-h] [-v VOICE] [-p] [-s SPEED] [-c] [-o FOLDER] epub_file_path
188
+
189
+ positional arguments:
190
+ epub_file_path Path to the epub file
191
+
192
+ options:
193
+ -h, --help show this help message and exit
194
+ -v VOICE, --voice VOICE
195
+ Choose narrating voice: a, b, e, f, h, i, j, p, z
196
+ -p, --pick Interactively select which chapters to read in the audiobook
197
+ -s SPEED, --speed SPEED
198
+ Set speed from 0.5 to 2.0
199
+ -c, --cuda Use GPU via Cuda in Torch if available
200
+ -o FOLDER, --output FOLDER
201
+ Output folder for the audiobook and temporary files
202
+
203
+ example:
204
+ bookvox book.epub -l en-us -v af_sky
205
+
206
+ to use the GUI, run:
207
+ bookvox-ui
208
+ ```
209
+
210
+ ## Author
211
+
212
+ by [Claudio Santini](https://claudio.uk) in 2025, distributed under MIT licence.
213
+
214
+ Related Article: [Audiblez v4: Generate Audiobooks from E-books](https://claudio.uk/posts/audiblez-v4.html)
215
+
@@ -0,0 +1,162 @@
1
+ # Bookvox: Generate audiobooks from e-books
2
+
3
+ [![Installing via pip and running](https://github.com/JHCodeQuest/bookvox/actions/workflows/pip-install.yaml/badge.svg)](https://github.com/JHCodeQuest/bookvox/actions/workflows/pip-install.yaml)
4
+ [![Git clone and run](https://github.com/JHCodeQuest/bookvox/actions/workflows/git-clone-and-run.yml/badge.svg)](https://github.com/JHCodeQuest/bookvox/actions/workflows/git-clone-and-run.yml)
5
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/bookvox)
6
+ ![PyPI - Version](https://img.shields.io/pypi/v/bookvox)
7
+
8
+ > **Bookvox is a maintained fork of [audiblez](https://github.com/santinic/audiblez) by [Claudio Santini](https://claudio.uk),**
9
+ > picking up from v0.4.9 after upstream development stopped in early 2026.
10
+ > All original work is his and remains under the MIT licence; see [`LICENSE`](./LICENSE).
11
+ > This fork exists to fix outstanding bugs, restore support for current Python versions,
12
+ > and land community contributions that were left open upstream.
13
+
14
+ ### v4 Now with Graphical interface, CUDA support, and many languages!
15
+
16
+ ![Bookvox GUI on MacOSX](./imgs/mac.png)
17
+
18
+ Bookvox generates `.m4b` audiobooks from regular `.epub` e-books,
19
+ using Kokoro's high-quality speech synthesis.
20
+
21
+ [Kokoro-82M](https://huggingface.co/hexgrad/Kokoro-82M) is a recently published text-to-speech model with just 82M params and very natural sounding output.
22
+ It's released under Apache licence and it was trained on < 100 hours of audio.
23
+ It currently supports these languages: 🇺🇸 🇬🇧 🇪🇸 🇫🇷 🇮🇳 🇮🇹 🇯🇵 🇧🇷 🇨🇳
24
+
25
+ On a Google Colab's T4 GPU via Cuda, **it takes about 5 minutes to convert "Animal's Farm" by Orwell** (which is about 160,000 characters) to audiobook, at a rate of about 600 characters per second.
26
+
27
+ On my M2 MacBook Pro, on CPU, it takes about 1 hour, at a rate of about 60 characters per second.
28
+
29
+
30
+ ## How to install the Command Line tool
31
+
32
+ If you have Python 3 on your computer, you can install it with pip.
33
+ You also need `espeak-ng` and `ffmpeg` installed on your machine:
34
+
35
+ ```bash
36
+ sudo apt install ffmpeg espeak-ng # on Ubuntu/Debian 🐧
37
+ pip install bookvox
38
+ ```
39
+
40
+ ```bash
41
+ brew install ffmpeg espeak-ng # on Mac 🍏
42
+ pip install bookvox
43
+ ```
44
+
45
+ Then you can convert an .epub directly with:
46
+
47
+ ```
48
+ bookvox book.epub -v af_sky
49
+ ```
50
+
51
+ It will first create a bunch of `book_chapter_1.wav`, `book_chapter_2.wav`, etc. files in the same directory,
52
+ and at the end it will produce a `book.m4b` file with the whole book you can listen with VLC or any
53
+ audiobook player.
54
+ It will only produce the `.m4b` file if you have `ffmpeg` installed on your machine.
55
+
56
+ ## How to run the GUI
57
+
58
+ The GUI is a simple graphical interface to use bookvox.
59
+ You need some extra dependencies to run the GUI:
60
+
61
+ ```
62
+ sudo apt install ffmpeg espeak-ng
63
+ sudo apt install libgtk-3-dev # just for Ubuntu/Debian 🐧, Windows/Mac don't need this
64
+
65
+ pip install bookvox pillow wxpython
66
+ ```
67
+
68
+ Then you can run the GUI with:
69
+ ```
70
+ bookvox-ui
71
+ ```
72
+
73
+ ## How to run on Windows
74
+
75
+ After many trials, on Windows we recommend to install bookvox in a Python venv:
76
+
77
+ 1. Open a Windows terminal
78
+ 2. Create anew folder: `mkdir bookvox`
79
+ 3. Enter the folder: `cd bookvox`
80
+ 4. Create a venv: `python -m venv venv`
81
+ 5. Activate the venv: `.\venv\Scripts\Activate.ps1`
82
+ 6. Install the dependencies: `pip install bookvox pillow wxpython`
83
+ 7. Now you can run `bookvox` or `bookvox-ui`
84
+ 8. For Cuda support, you need to install Pytorch accordingly: https://pytorch.org/get-started/locally/
85
+
86
+
87
+ ## Speed
88
+
89
+ By default the audio is generated using a normal speed, but you can make it up to twice slower or faster by specifying a speed argument between 0.5 to 2.0:
90
+
91
+ ```
92
+ bookvox book.epub -v af_sky -s 1.5
93
+ ```
94
+
95
+ ## Supported Voices
96
+
97
+ Use `-v` option to specify the voice to use. Available voices are listed here.
98
+ The first letter is the language code and the second is the gender of the speaker e.g. `im_nicola` is an italian male voice.
99
+
100
+ [For hearing samples of Kokoro-82M voices, go here](https://claudio.uk/posts/audiblez-v4.html)
101
+
102
+ | Language | Voices |
103
+ |---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
104
+ | 🇺🇸 American English | `af_alloy`, `af_aoede`, `af_bella`, `af_heart`, `af_jessica`, `af_kore`, `af_nicole`, `af_nova`, `af_river`, `af_sarah`, `af_sky`, `am_adam`, `am_echo`, `am_eric`, `am_fenrir`, `am_liam`, `am_michael`, `am_onyx`, `am_puck`, `am_santa` |
105
+ | 🇬🇧 British English | `bf_alice`, `bf_emma`, `bf_isabella`, `bf_lily`, `bm_daniel`, `bm_fable`, `bm_george`, `bm_lewis` |
106
+ | 🇪🇸 Spanish | `ef_dora`, `em_alex`, `em_santa` |
107
+ | 🇫🇷 French | `ff_siwis` |
108
+ | 🇮🇳 Hindi | `hf_alpha`, `hf_beta`, `hm_omega`, `hm_psi` |
109
+ | 🇮🇹 Italian | `if_sara`, `im_nicola` |
110
+ | 🇯🇵 Japanese | `jf_alpha`, `jf_gongitsune`, `jf_nezumi`, `jf_tebukuro`, `jm_kumo` |
111
+ | 🇧🇷 Brazilian Portuguese | `pf_dora`, `pm_alex`, `pm_santa` |
112
+ | 🇨🇳 Mandarin Chinese | `zf_xiaobei`, `zf_xiaoni`, `zf_xiaoxiao`, `zf_xiaoyi`, `zm_yunjian`, `zm_yunxi`, `zm_yunxia`, `zm_yunyang` |
113
+
114
+ For more detaila about voice quality, check this document: [Kokoro-82M voices](https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md)
115
+
116
+ ## How to run on GPU
117
+
118
+ By default, bookvox runs on CPU. If you pass the option `--cuda` it will try to use the Cuda device via Torch.
119
+
120
+ Check out this example: [Bookvox running on a Google Colab Notebook with Cuda ](https://colab.research.google.com/drive/164PQLowogprWQpRjKk33e-8IORAvqXKI?usp=sharing]).
121
+
122
+ We don't currently support Apple Silicon, as there is not yet a Kokoro implementation in MLX. As soon as it will be available, we will support it.
123
+
124
+ ## Manually pick chapters to convert
125
+
126
+ Sometimes you want to manually select which chapters/sections in the e-book to read out loud.
127
+ To do so, you can use `--pick` to interactively choose the chapters to convert (without running the GUI).
128
+
129
+
130
+ ## Help page
131
+
132
+ For all the options available, you can check the help page `bookvox --help`:
133
+
134
+ ```
135
+ usage: bookvox [-h] [-v VOICE] [-p] [-s SPEED] [-c] [-o FOLDER] epub_file_path
136
+
137
+ positional arguments:
138
+ epub_file_path Path to the epub file
139
+
140
+ options:
141
+ -h, --help show this help message and exit
142
+ -v VOICE, --voice VOICE
143
+ Choose narrating voice: a, b, e, f, h, i, j, p, z
144
+ -p, --pick Interactively select which chapters to read in the audiobook
145
+ -s SPEED, --speed SPEED
146
+ Set speed from 0.5 to 2.0
147
+ -c, --cuda Use GPU via Cuda in Torch if available
148
+ -o FOLDER, --output FOLDER
149
+ Output folder for the audiobook and temporary files
150
+
151
+ example:
152
+ bookvox book.epub -l en-us -v af_sky
153
+
154
+ to use the GUI, run:
155
+ bookvox-ui
156
+ ```
157
+
158
+ ## Author
159
+
160
+ by [Claudio Santini](https://claudio.uk) in 2025, distributed under MIT licence.
161
+
162
+ Related Article: [Audiblez v4: Generate Audiobooks from E-books](https://claudio.uk/posts/audiblez-v4.html)
@@ -0,0 +1,3 @@
1
+ import os, sys
2
+
3
+ sys.path.append(os.path.dirname(os.path.realpath(__file__)))
@@ -0,0 +1,43 @@
1
+ # -*- coding: utf-8 -*-
2
+ import argparse
3
+ import sys
4
+
5
+ from bookvox.voices import voices, available_voices_str
6
+
7
+
8
+ def cli_main():
9
+ voices_str = ', '.join(voices)
10
+ epilog = ('example:\n' +
11
+ ' bookvox book.epub -l en-us -v af_sky\n\n' +
12
+ 'to run GUI just run:\n'
13
+ ' bookvox-ui\n\n' +
14
+ 'available voices:\n' +
15
+ available_voices_str)
16
+ default_voice = 'af_sky'
17
+ parser = argparse.ArgumentParser(epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter)
18
+ parser.add_argument('epub_file_path', help='Path to the epub file')
19
+ parser.add_argument('-v', '--voice', default=default_voice, help=f'Choose narrating voice: {voices_str}')
20
+ parser.add_argument('-p', '--pick', default=False, help=f'Interactively select which chapters to read in the audiobook', action='store_true')
21
+ parser.add_argument('-s', '--speed', default=1.0, help=f'Set speed from 0.5 to 2.0', type=float)
22
+ parser.add_argument('-c', '--cuda', default=False, help=f'Use GPU via Cuda in Torch if available', action='store_true')
23
+ parser.add_argument('-o', '--output', default='.', help='Output folder for the audiobook and temporary files', metavar='FOLDER')
24
+
25
+ if len(sys.argv) == 1:
26
+ parser.print_help(sys.stderr)
27
+ sys.exit(1)
28
+ args = parser.parse_args()
29
+
30
+ if args.cuda:
31
+ import torch.cuda
32
+ if torch.cuda.is_available():
33
+ print('CUDA GPU available')
34
+ torch.set_default_device('cuda')
35
+ else:
36
+ print('CUDA GPU not available. Defaulting to CPU')
37
+
38
+ from core import main
39
+ main(args.epub_file_path, args.voice, args.pick, args.speed, args.output)
40
+
41
+
42
+ if __name__ == '__main__':
43
+ cli_main()