Listen to your favourite audiobook
Project description
👉 Listen to any PDF book with a few lines of Python code👈
Installation
Install using pypi
Linux(setup script)
sh setup.sh
windows and linux
pip install audiobook
Usages
The audiobook is a python module for listening to your favourite PDF book.
from audiobook import AudioBook
# argument: Speech-Speed="slow/normal/fast", volume = 0.0 to 1.0
ab = AudioBook(speed="normal", volume=1.0)
# if file is password protected, pass password as argument
# save_page_wise audio/whole book in one mp3 file
ab.save_audio(self, input_book_path, password=None, save_page_wise=False):
- input_book_path: path to pdf file
- password: password to pdf file
- save_page_wise: if True, saves each page as a separate mp3 file
- extraction_engine: "pypdf2/pdfminor" for extracting text from pdf file
ab.read_book(file_path) # listen to the book
ab.create_json_book(file_path) # create json file of the book
ab.get_library() # get all the books in your library
Supported File Formats
| File Format | Supported | Engine |
|---|---|---|
| :white_check_mark: | pypdf2/pdfminor | |
| TXT | :white_check_mark: | not required |
| EPUB | :white_check_mark: | not required |
| MOBI | :white_check_mark: | not required |
| HTML | :white_check_mark: | not required |
| DOCX | :white_check_mark: | not required |
| ODT | :x: | not required |
Test
Run tests:
pip install -r requirements.txt
python -m unittest tests
Documentation
Read Detailed Documentation here
Linux Installation Requirements
- If you are using a Linux system and the voice output is not working, then : Install espeak , ffmpeg and libespeak1 as shown below:
sudo apt update && sudo apt install espeak ffmpeg libespeak1
Roadmap
- Speech-Speed Control
- Support more extensions
- Save the audiobook for future
Project status
This project is currently in development. Any contributions are welcome.
Changelog
V2.0.2
- Docs files support added
- Pdfminor as engine added
V2.0.1
- Mobi file support
- Epub file support
- User can now save the audiobook for future
- User library added
- [
V2.0.0
- Save Audio Book locally
- Listen to the book
- Speech-speed control
- Read password-protected PDF
- Create JSON file for the book
** Upcoming changes**
- Change the voice of the narrator
- Support more extensions
Author
- Module : AudioBook
- Author : py-contributors
- Language : Python
Contributors
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
audiobook-2.0.2.tar.gz
(10.2 kB
view details)
File details
Details for the file audiobook-2.0.2.tar.gz.
File metadata
- Download URL: audiobook-2.0.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
376ecd441a1bb1707e4027d93c5efe1efcc0570de74154351a60a72398b11a94
|
|
| MD5 |
ea5b5793b676215702c7ec08e949e434
|
|
| BLAKE2b-256 |
6bc460d003cc4089684b76e6439cd9bc3e090fe05fdee635c098f77b5a923232
|