readme/README_ind.md
Konverter CPU/GPU dari E-Book ke buku audio dengan bab dan metadata
menggunakan mesin TTS canggih dan banyak lagi.
Mendukung kloning suara dan 1158 bahasa!
[!IMPORTANT] Alat ini ditujukan hanya untuk digunakan dengan eBook tanpa DRM yang diperoleh secara legal.
Penulis tidak bertanggung jawab atas penyalahgunaan perangkat lunak ini atau konsekuensi hukum yang timbul.
Gunakan alat ini secara bertanggung jawab dan sesuai dengan semua hukum yang berlaku.
</a><a href="https://hub.docker.com/r/athomasson2/ebook2audiobook">
</a>Demo Suara Default Baru
https://github.com/user-attachments/assets/750035dc-e355-46f1-9286-05c1d9e88cea
<details> <summary>Demo lainnya</summary>Suara ASMR
https://github.com/user-attachments/assets/68eee9a1-6f71-4903-aacd-47397e47e422
Suara Hari Hujan
https://github.com/user-attachments/assets/d25034d9-c77f-43a9-8f14-0d167172b080
Suara Scarlett
https://github.com/user-attachments/assets/b12009ee-ec0d-45ce-a1ef-b3a52b9f8693
Suara David Attenborough
https://github.com/user-attachments/assets/81c4baad-117e-4db5-ac86-efc2b7fea921
Contoh
</details>🔧 Mesin TTS yang didukung: XTTSv2, Bark, Fairseq, VITS, Tacotron2, Tortoise, GlowTTS, YourTTS
📚 Mengonversi berbagai format file: .epub, .mobi, .azw3, .fb2, .lrf, .rb, .snb, .tcr, .pdf, .txt, .rtf, .doc, .docx, .html, .odt, .azw, .tiff, .tif, .png, .jpg, .jpeg, .bmp, .zip
💻 Area Teks untuk langsung mengonversi teks pendek menjadi audio
🔍 Pemindaian OCR untuk file dengan halaman teks berupa gambar
🔊 Text-to-speech berkualitas tinggi, dari hampir waktu nyata hingga suara hampir nyata
🗣️ Kloning suara opsional menggunakan file suara Anda sendiri
🌐 Mendukung 1158 bahasa (supported languages list)
💻 Ramah sumber daya rendah — berjalan pada 2 GB RAM / 1 GB VRAM (minimum)
🎵 Format keluaran buku audio: mono or stereo aac, flac, mp3, m4b, m4a, mp4, mov, ogg, wav, webm
🧠 Tag SML didukung — kontrol terperinci atas jeda, hentian, peralihan suara, dan lainnya (see below)
🧩 Model kustom opsional menggunakan model latih Anda sendiri (XTTSv2, VITS, FAIRSEQ, PIPER, others on request)
🎛️ Model preset yang disetel halus yang dilatih oleh Tim E2A
<i>(Hubungi kami jika Anda memerlukan model yang disetel halus tambahan, atau jika Anda ingin membagikan milik Anda ke daftar preset resmi)</i>
*<i> Mesin TTS modern sangat lambat di CPU, jadi gunakan TTS berkualitas lebih rendah seperti YourTTS, Tacotron2 dll.</i>
| Arabic (ar) | Chinese (zh) | English (en) | Spanish (es) |
|---|---|---|---|
| French (fr) | German (de) | Italian (it) | Portuguese (pt) |
| Polish (pl) | Turkish (tr) | Russian (ru) | Dutch (nl) |
| Czech (cs) | Japanese (ja) | Hindi (hi) | Bengali (bn) |
| Hungarian (hu) | Korean (ko) | Vietnamese (vi) | Swedish (sv) |
| Persian (fa) | Yoruba (yo) | Swahili (sw) | Indonesian (id) |
| Slovak (sk) | Croatian (hr) | Tamil (ta) | Danish (da) |
.epub, .pdf, .mobi, .txt, .html, .rtf, .chm, .lit,
.pdb, .fb2, .odt, .cbr, .cbz, .prc, .lrf, .pml,
.snb, .cbc, .rb, .tcr.epub atau .mobi untuk deteksi bab otomatis.m4b, .m4a, .mp4, .webm, .mov, .mp3, .flac, .wav, .ogg, .aac[break] — hening (rentang acak 0.3–0.6 sec.)[pause] — hening (rentang acak 1.0–1.6 sec.)[pause:N] — jeda tetap (N sec.)[voice:/path/to/voice/file]...[/voice] — alihkan suara dari suara default atau suara yang dipilih dari GUI/CLILihat repo kami yang lain yang didedikasikan untuk menambahkan SML secara otomatis di eBook Anda -> E2A-SML
[!IMPORTANT] **Sebelum memposting masalah pemasangan atau bug, cari dengan cermat di TAB masalah yang terbuka dan tertutup
untuk memastikan masalah Anda belum ada.**
[!NOTE] **Format EPUB tidak memiliki struktur standar apa pun seperti apa itu bab, paragraf, kata pengantar, dll.
Jadi Anda harus terlebih dahulu menghapus secara manual teks apa pun yang tidak ingin Anda konversi menjadi audio.**
Klon repo
git clone https://github.com/DrewThomasson/ebook2audiobook.git
cd ebook2audiobook
Pasang / Jalankan ebook2audiobook:
Linux/MacOS
./ebook2audiobook.command
<i>Catatan untuk pengguna MacOS: homebrew dipasang untuk memasang program yang hilang.</i>
Peluncur Mac
Klik dua kali Mac Ebook2Audiobook Launcher.command
Windows
ebook2audiobook.cmd
atau
Klik dua kali ebook2audiobook.cmd
<i>Catatan untuk pengguna Windows: scoop dipasang untuk memasang program yang hilang tanpa hak istimewa administrator.</i>
Buka Aplikasi Web: Klik URL yang disediakan di terminal untuk mengakses aplikasi web dan mengonversi eBook. http://localhost:7860/
Untuk Tautan Publik:
./ebook2audiobook.command --share (Linux/MacOS)
ebook2audiobook.cmd --share (Windows)
python app.py --share (all OS)
[!IMPORTANT] **Jika skrip dihentikan dan dijalankan lagi, Anda perlu menyegarkan antarmuka GUI gradio Anda
agar halaman web dapat terhubung kembali ke soket koneksi yang baru.**
Linux/MacOS:
./ebook2audiobook.command --headless --ebook <path_to_ebook_file> --voice <path_to_voice_file> --language <language_code>
Windows
ebook2audiobook.cmd --headless --ebook <path_to_ebook_file> --voice <path_to_voice_file> --language <language_code>
[--ebook]: Jalur ke file eBook Anda
[--voice]: Jalur file kloning suara (opsional)
[--language]: Kode bahasa dalam ISO-639-3 (yaitu: ita untuk Italia, eng untuk Inggris, deu untuk Jerman...).
Bahasa default adalah eng dan --language bersifat opsional untuk bahasa default yang diatur di ./lib/lang.py.
Kode ISO-639-1 2 huruf juga didukung.
(harus berupa file .zip yang berisi file model wajib. Contoh untuk XTTSv2: config.json, model.pth, vocab.json dan ref.wav)
Linux/MacOS
./ebook2audiobook.command --headless --ebook <ebook_file_path> --language <language> --custom_model <custom_model_path>
Windows
ebook2audiobook.cmd --headless --ebook <ebook_file_path> --language <language> --custom_model <custom_model_path>
<i>Catatan: ref.wav dari model kustom Anda selalu merupakan suara yang dipilih untuk konversi</i>
<custom_model_path>: Jalur ke file model_name.zip,
yang harus berisi (sesuai mesin tts) semua file wajib
(lihat ./lib/models.py).
./ebook2audiobook.command --help
ebook2audiobook.cmd --help
python app.py --help <a id="help-command-output"></a>
usage: app.py [-h] [--session SESSION] [--share] [--headless] [--ebook EBOOK] [--ebooks_dir EBOOKS_DIR]
[--language LANGUAGE] [--voice VOICE] [--voice_map VOICE_MAP] [--device {CPU,CUDA,MPS,ROCM,XPU,JETSON}]
[--tts_engine {XTTS,BARK,VITS,FAIRSEQ,TACOTRON,YOURTTS,xtts,bark,vits,fairseq,tacotron,yourtts}]
[--custom_model CUSTOM_MODEL] [--fine_tuned FINE_TUNED] [--output_format OUTPUT_FORMAT]
[--output_channel OUTPUT_CHANNEL] [--temperature TEMPERATURE] [--length_penalty LENGTH_PENALTY]
[--num_beams NUM_BEAMS] [--repetition_penalty REPETITION_PENALTY] [--top_k TOP_K] [--top_p TOP_P]
[--speed SPEED] [--enable_text_splitting] [--text_temp TEXT_TEMP] [--waveform_temp WAVEFORM_TEMP]
[--output_dir OUTPUT_DIR] [--version]
Convert eBooks to Audiobooks using a Text-to-Speech model. You can either launch the Gradio interface or run the script in headless mode for direct conversion.
options:
-h, --help show this help message and exit
--session SESSION Session to resume the conversion in case of interruption, crash,
or reuse of custom models and custom cloning voices.
**** The following option is for gradio/gui mode only:
--share (Optional) Enable a public shareable Gradio link.
**** The following options are for --headless mode only:
--headless Run the script in headless mode
--ebook EBOOK Path to the ebook file for conversion. Cannot be used when --ebooks_dir is present.
--ebooks_dir EBOOKS_DIR
Relative or absolute path of the directory containing the files to convert.
Cannot be used when --ebook is present.
--text TEXT Raw text for conversion. Cannot be used when --ebook or --ebooks_dir is present.
--language LANGUAGE Language of the e-book. Default language is set
in ./lib/lang.py sed as default if not present. All compatible language codes are in ./lib/lang.py
optional parameters:
--translate ISO3 (Optional) Translate ebook to a target language (ISO 639-3 code, e.g. eng, fra, deu) before TTS synthesis.
Uses argostranslate. The target language becomes the effective TTS language for the run.
A copy of the source ebook is made with the _<iso3> suffix so translated and non-translated
outputs stay isolated (independent process folder, audio chunks, and final file).
--voice VOICE (Optional) Path to the voice cloning file for TTS engine.
Uses the default voice if not present.
--voice_map VOICE_MAP
(Optional, --ebooks_dir only) Path to a JSON file mapping ebook path -> voice path.
Each entry overrides --voice for that specific ebook. Missing/null entries fall back to --voice.
Keys may be absolute paths or basenames. Example:
{"book1.epub": "/voices/eng/adult/female/alice.wav", "/abs/path/book2.epub": null}
--device {CPU,CUDA,MPS,ROCM,XPU,JETSON}
(Optional) Processor unit type for the conversion.
Default is set in ./lib/conf.py if not present. Fall back to CPU if CUDA or MPS is not available.
--tts_engine {XTTS,BARK,VITS,FAIRSEQ,TACOTRON,YOURTTS,xtts,bark,vits,fairseq,tacotron,yourtts}
(Optional) Preferred TTS engine (available are: ['XTTS', 'BARK', 'VITS', 'FAIRSEQ', 'TACOTRON', 'YOURTTS', 'xtts', 'bark', 'vits', 'fairseq', 'tacotron', 'yourtts'].
Default depends on the selected language. The tts engine should be compatible with the chosen language
--custom_model CUSTOM_MODEL
(Optional) Path to the custom model zip file cntaining mandatory model files.
Please refer to ./lib/models.py
--fine_tuned FINE_TUNED
(Optional) Fine tuned model path. Default is builtin model.
--output_format OUTPUT_FORMAT
(Optional) Output audio format. Default is m4b set in ./lib/conf.py
--output_channel OUTPUT_CHANNEL
(Optional) Output audio channel. Default is mono set in ./lib/conf.py
--temperature TEMPERATURE
(xtts only, optional) Temperature for the model.
Default to config.json model. Higher temperatures lead to more creative outputs.
--length_penalty LENGTH_PENALTY
(xtts only, optional) A length penalty applied to the autoregressive decoder.
Default to config.json model. Not applied to custom models.
--num_beams NUM_BEAMS
(xtts only, optional) Controls how many alternative sequences the model explores. Must be equal or greater than length penalty.
Default to config.json model.
--repetition_penalty REPETITION_PENALTY
(xtts only, optional) A penalty that prevents the autoregressive decoder from repeating itself.
Default to config.json model.
--top_k TOP_K (xtts only, optional) Top-k sampling.
Lower values mean more likely outputs and increased audio generation speed.
Default to config.json model.
--top_p TOP_P (xtts only, optional) Top-p sampling.
Lower values mean more likely outputs and increased audio generation speed. Default to config.json model.
--speed SPEED (xtts only, optional) Speed factor for the speech generation.
Default to config.json model.
--enable_text_splitting
(xtts only, optional) Enable TTS text splitting. This option is known to not be very efficient.
Default to config.json model.
--text_temp TEXT_TEMP
(bark only, optional) Text Temperature for the model.
Default to config.json model.
--waveform_temp WAVEFORM_TEMP
(bark only, optional) Waveform Temperature for the model.
Default to config.json model.
--output_dir OUTPUT_DIR
(Optional) Path to the output directory. Default is set in ./lib/conf.py
--version Show the version of the script and exit
Example usage:
Windows:
Gradio/GUI:
ebook2audiobook.cmd
Headless mode:
ebook2audiobook.cmd --headless --ebook '/path/to/file' --language eng
Linux/Mac:
Gradio/GUI:
./ebook2audiobook.command
Headless mode:
./ebook2audiobook.command --headless --ebook '/path/to/file' --language eng
SML tags available:
[break] — silence (random range **0.3–0.6 sec.**)
[pause] — silence (random range **1.0–1.6 sec.**)
[pause:N] — fixed pause (**N sec.**)
[voice:/path/to/voice/file]...[/voice] — switch voice from default or selected voice from GUI/CLI
CATATAN: dalam mode gradio/gui, untuk membatalkan konversi yang sedang berjalan, cukup klik [X] dari komponen unggah eBook. TIPS: jika perlu jeda lebih lama, tambahkan '[pause:3]' untuk 3 dtk. dll.
git clone https://github.com/DrewThomasson/ebook2audiobook.git
cd ebook2audiobook
Windows:
Docker:
ebook2audiobook.cmd --script_mode build_docker
Docker Compose:
ebook2audiobook.cmd --script_mode build_docker --docker_mode compose
Podman Compose:
ebook2audiobook.cmd --script_mode build_docker --docker_mode podman
Linux/Mac
Docker:
./ebook2audiobook.command --script_mode build_docker
Docker Compose
./ebook2audiobook.command --script_mode build_docker --docker_mode compose
Podman Compose:
./ebook2audiobook.command --script_mode build_docker --docker_mode podman
Docker run image:
Gradio/GUI:
CPU:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" --rm -it -p 7860:7860 athomasson2/ebook2audiobook:cpu
CUDA:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" --gpus all --rm -it -p 7860:7860 athomasson2/ebook2audiobook:cu[118/122/124/126 etc..]
ROCM:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" --device=/dev/kfd --device=/dev/dri --rm -it -p 7860:7860 athomasson2/ebook2audiobook:rocm[6.0/6.1/6.4 etc..]
XPU:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" --device=/dev/dri --rm -it -p 7860:7860 athomasson2/ebook2audiobook:xpu
JETSON:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" --runtime nvidia --rm -it -p 7860:7860 athomasson2/ebook2audiobook:jetson[51/60/61 etc...]
Headless mode:
CPU:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" -v "/my/real/ebooks/folder/absolute/path:/app/another_ebook_folder" --rm -it -p 7860:7860 ebook2audiobook:cpu --headless --ebook "/app/another_ebook_folder/myfile.pdf" [--voice /app/my/voicepath/voice.mp3 etc..]
CUDA:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" -v "/my/real/ebooks/folder/absolute/path:/app/another_ebook_folder" --gpus all --rm -it -p 7860:7860 ebook2audiobook:cu[118/122/124/126 etc..] --headless --ebook "/app/another_ebook_folder/myfile.pdf" [--voice /app/my/voicepath/voice.mp3 etc..]
ROCM:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" -v "/my/real/ebooks/folder/absolute/path:/app/another_ebook_folder" --device=/dev/kfd --device=/dev/dri --rm -it -p 7860:7860 ebook2audiobook:rocm[6.0/6.1/6.4 etc.] --headless --ebook "/app/another_ebook_folder/myfile.pdf" [--voice /app/my/voicepath/voice.mp3 etc..]
XPU:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" -v "/my/real/ebooks/folder/absolute/path:/app/another_ebook_folder" --device=/dev/dri --rm -it -p 7860:7860 ebook2audiobook:xpu --headless --ebook "/app/another_ebook_folder/myfile.pdf" [--voice /app/my/voicepath/voice.mp3 etc..]
JETSON:
docker run -v "./ebooks:/app/ebooks" -v "./audiobooks:/app/audiobooks" -v "./models:/app/models" -v "./voices:/app/voices" -v "./tmp:/app/tmp" -v "/my/real/ebooks/folder/absolute/path:/app/another_ebook_folder" --runtime nvidia --rm -it -p 7860:7860 ebook2audiobook:jetson[51/60/61 etc.] --headless --ebook "/app/another_ebook_folder/myfile.pdf" [--voice /app/my/voicepath/voice.mp3 etc..]
Docker Compose (i.e. cuda 12.8:
Run Gradio GUI:
DEVICE_TAG=cu128 docker compose --profile gpu up --no-log-prefix
Run Headless mode:
DEVICE_TAG=cu128 docker compose --profile gpu run --rm ebook2audiobook --headless --ebook "/app/ebooks/myfile.pdf" --voice /app/voices/eng/adult/female/some_voice.wav etc..
Podman Compose (i.e. cuda 12.8:
Run Gradio GUI:
DEVICE_TAG=cu128 podman-compose -f podman-compose.yml --profile gpu up
Run Headless mode:
DEVICE_TAG=cu128 podman-compose -f podman-compose.yml --profile gpu run --rm ebook2audiobook-gpu --headless --ebook "/app/ebooks/myfile.pdf" --voice /app/voices/eng/adult/female/some_voice.wav etc..
Untuk model kustom XTTSv2, klip audio referensi dari suara referensi wajib ada:
Anda bebas memodifikasi libs/conf.py untuk menambah atau menghapus pengaturan yang Anda inginkan. Jika Anda berencana melakukannya, cukup buat salinan conf.py asli sehingga pada setiap pembaruan ebook2audiobook Anda akan mencadangkan conf.py yang dimodifikasi dan mengembalikan yang asli. Anda harus merencanakan proses yang sama untuk models.py. Jika Anda ingin menjadikan model kustom Anda sendiri sebagai model ebook2audiobook resmi yang disetel halus, silakan hubungi kami dan kami akan menambahkannya ke daftar preset.
Rilis dapat ditemukan -> di sini
git checkout tags/VERSION_NUM # Locally/Compose -> Example: git checkout tags/v25.7.7
--help di akhir perintah docker run untuk informasi lebih lanjut.Contoh:
import json
from typing import Optional
def get_user(user_id:int, users:list[dict])->Optional[dict]:
for user in users:
if user['id'] == user_id:
return user
return None
def summarize(user:dict)->str:
return f"User {user['name']} is {'active' if user['is_active'] else 'inactive'}."
def to_json(user:dict)->str:
return json.dumps({"id": user['id'], "name": user['name'], "email": user['email']})
users:list = [
dict(id=1, name="alice", email="[email protected]", role="admin", is_active=True),
dict(id=2, name="bob", email="[email protected]", role="editor", is_active=False),
dict(id=3, name="carol", email="[email protected]", role="viewer", is_active=True),
]
config = {
"max_users": 100,
"default_role": "viewer",
"allow_signup": True,
}
roles = ['admin', 'editor', 'viewer']
found = get_user(1, users)
if found:
print(summarize(found))
print(found['email'])
print(to_json(found))
if config['default_role'] in roles:
print(config['default_role'])
Kami menerima segala jenis perangkat keras untuk menguji pengembangan kami seperti:
@DrewThomasson jika Anda ingin membantu dengan cara apa pun! 😃
<!-- ## Apakah Anda perlu menyewa GPU untuk meningkatkan layanan dari kami? - Sebuah jajak pendapat dibuka di sini https://github.com/DrewThomasson/ebook2audiobook/discussions/889 -->