Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions BasicPythonScripts/audiobook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Installation

Install using [pypi](https://pypi.org/project/audiobook/)

```sh
pip install audiobook
```

```python
from audiobook import AudioBook
ab = AudioBook(speed="normal") # argument: Speech-Speed="slow/normal/fast"

ab.save_audio(file_path, password=None) # save audio file
ab.read_book(file_path, password=None) # listen to the book
```

## Usages

The audiobook is a python module for listening to your favourite PDF book.

## Documentation

Read Detailed [Documentation here](https://audiobook.readthedocs.io/)

### 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:

```sh
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.0**

- [x] Save Audio Book locally
- [x] Listen to the book
- [x] Speech-speed control
- [x] Read password-protected PDF
- [x] Create JSON file for the book
- [ ] Change the voice of the narrator

- [ ] Support more extensions

## contributor: @codeperfectplus
## full code: https://github.com/Py-Contributors/audiobook
## Pypi: https://pypi.org/project/audiobook/

## requirements.txt audiobook==2.0.0
1 change: 1 addition & 0 deletions BasicPythonScripts/audiobook/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
audiobook
28 changes: 28 additions & 0 deletions BasicPythonScripts/audiobook/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from audiobook import AudioBook
import argparse

arg = argparse.ArgumentParser()
arg.add_argument("-f", "--file", required=True, help="Path to file")
args = vars(arg.parse_args())

ab = AudioBook(speed="normal") # default speed is normal/slow/fast

def read_book(input_file_path):
""" if you want to read your book """
ab.create_json_book(input_file_path)


def save_audio(input_file_path):
""" if you want to save your audio books """
ab.save_audio(input_file_path)

if __name__ == "__main__":
input_file_path = args["file"]
read_book(input_file_path)
# save_audio(input_file_path)

# contributor: @codeperfectplus
# full code: https://github.com/Py-Contributors/audiobook
# Pypi: https://pypi.org/project/audiobook/

# requirements.txt audiobook==2.0.0