mirror of
https://github.com/santinic/audiblez.git
synced 2025-04-13 09:38:57 +00:00
fix
This commit is contained in:
parent
4febc7cea9
commit
2a1e687020
4 changed files with 59 additions and 33 deletions
2
.github/workflows/pip-install.yaml
vendored
2
.github/workflows/pip-install.yaml
vendored
|
@ -2,7 +2,7 @@ name: GitHub Action for installing and testing the package on Python 3.11
|
||||||
run-name: pip install and run
|
run-name: pip install and run
|
||||||
on: [ push, pull_request ]
|
on: [ push, pull_request ]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
install-and-run:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Python 3.11
|
- name: Set up Python 3.11
|
||||||
|
|
73
README.md
73
README.md
|
@ -1,44 +1,63 @@
|
||||||
# Audiblez: Create audiobooks from e-books
|
# Audiblez: Generate audiobooks from e-books
|
||||||
|
|
||||||
Audiblez converts .epub into .mp3 using high-quality and lightweight Kokoro-82M text-to-speech models.
|
Audiblez generates `.m4b` audiobooks from regular `.epub` e-books,
|
||||||
|
using Kokoro's high-quality speech synthesis.
|
||||||
|
|
||||||
|
[Kokoro v0.19](https://huggingface.co/hexgrad/Kokoro-82M) is a recently published text-to-speech model with just 82M params and very natural sounding output.
|
||||||
|
It's released under Apache licence and it was trained on < 100 hours of audio.
|
||||||
|
It currently supports American, British English, French, Korean, Japanese and Mandarin, and a bunch of very good voices.
|
||||||
|
|
||||||
# How to install
|
An example of the quality:
|
||||||
|
|
||||||
```
|
<audio controls=""><source type="audio/wav" src="https://huggingface.co/hexgrad/Kokoro-82M/resolve/main/demo/HEARME.wav"></audio>
|
||||||
pip install audiblez # via Python PIP
|
|
||||||
|
|
||||||
brew install audiblez # On MacOSX via homebrew
|
On my M2 MacBook Pro, **it takes about 2 hours to convert to mp3 the Selfish Gene by Richard Dawkins**, which is about 100,000 words (or 600,000 characters),
|
||||||
|
at a rate of about 80 characters per second.
|
||||||
|
|
||||||
apt get install audiblez # On Ubuntu/Debian
|
## How to install and run
|
||||||
|
|
||||||
|
If you have python3 on your computer, you can install it with pip.
|
||||||
|
Then you also need to download the onnx and voices files in the same folder, which are about ~360MB:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install audiblez
|
||||||
|
wget https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files/kokoro-v0_19.onnx
|
||||||
|
wget https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files/voices.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Then to convert an epub file into an audiobook, just run:
|
||||||
|
|
||||||
# From sources
|
```bash
|
||||||
|
audiblez book.epub -l en-gb -v af_sky
|
||||||
```
|
|
||||||
# Get the model
|
|
||||||
wget
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
It will first create a bunch of `book_chapter_1.wav`, `book_chapter_2.wav`, etc. files in the same directory,
|
||||||
|
and at the end it will produce a `book.m4b` file with the whole book you can listen with VLC or any
|
||||||
|
audiobook player.
|
||||||
|
It will only produce the `.m4b` file if you have `ffmpeg` installed on your machine.
|
||||||
|
|
||||||
# How to run
|
## Supported Languages
|
||||||
|
|
||||||
`audiblez book.epub book.mp3`
|
- 🇺🇸 en-US
|
||||||
|
- 🇬🇧 en-GB
|
||||||
|
- 🇫🇷 fr-FR
|
||||||
|
- 🇯🇵 ja-JP
|
||||||
|
- 🇰🇷 ko-KR
|
||||||
|
- 🇨🇳 zh-CN
|
||||||
|
|
||||||
# Change language
|
## Supported Voices
|
||||||
|
|
||||||
use `-l` to specify language, eg:
|
You can try them here: [https://huggingface.co/spaces/hexgrad/Kokoro-TTS](https://huggingface.co/spaces/hexgrad/Kokoro-TTS)
|
||||||
|
|
||||||
`audiblez -l en-gb book.epub book.mp3`
|
- af
|
||||||
|
- af_bella
|
||||||
Kokoro supports these languages:
|
- af_nicole
|
||||||
|
- af_sarah
|
||||||
```
|
- af_sky
|
||||||
en-us
|
- am_adam
|
||||||
en-gb
|
- am_michael
|
||||||
fr-fr
|
- bf_emma
|
||||||
```
|
- bf_isabella
|
||||||
|
- bm_george
|
||||||
# Change voice
|
- bm_lewis
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# audiblez - A program to convert e-books into audiobooks using high-quality
|
# audiblez - A program to convert e-books into audiobooks using
|
||||||
# Kokoro-82M text-to-speech model.
|
# Kokoro-82M model for high-quality text-to-speech synthesis.
|
||||||
# Distributed under the MIT License for educational purposes.
|
# by Claudio Santini 2025 - https://claudio.uk
|
||||||
# by Claudio Santini (2025) - https://claudio.uk
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
|
|
@ -3,7 +3,7 @@ name = "audiblez"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = ""
|
description = ""
|
||||||
authors = [
|
authors = [
|
||||||
{name = "Claudio Santini",email = "hireclaudio@gmail.com"}
|
{ name = "Claudio Santini", email = "hireclaudio@gmail.com" }
|
||||||
]
|
]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11,<3.13"
|
requires-python = ">=3.11,<3.13"
|
||||||
|
@ -81,3 +81,11 @@ dependencies = [
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Homepage = "https://claudio.uk/posts/epub-to-audiobook.html"
|
||||||
|
Documentation = "https://github.com/santinic/audiblez"
|
||||||
|
Repository = "https://github.com/santinic/audiblez"
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
audiblez = "audiblez.cli:main"
|
Loading…
Add table
Reference in a new issue