From e6021b0cff2cfcfb3b1120e5c24acb244bf10d0d Mon Sep 17 00:00:00 2001 From: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com> Date: Sat, 15 Oct 2022 08:24:03 -0700 Subject: [PATCH 1/7] Adding audiobook script --- Python/audiobook/script.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Python/audiobook/script.py diff --git a/Python/audiobook/script.py b/Python/audiobook/script.py new file mode 100644 index 000000000..b8968b823 --- /dev/null +++ b/Python/audiobook/script.py @@ -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 From d2067f2f57577009574d25901f715ac5d9f3bb1c Mon Sep 17 00:00:00 2001 From: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com> Date: Sat, 15 Oct 2022 08:27:33 -0700 Subject: [PATCH 2/7] Create README.md --- Python/audiobook/README.md | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Python/audiobook/README.md diff --git a/Python/audiobook/README.md b/Python/audiobook/README.md new file mode 100644 index 000000000..c7e84a609 --- /dev/null +++ b/Python/audiobook/README.md @@ -0,0 +1,64 @@ +## 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. + +## Test + +Run tests: + +```sh +pip install -r requirements.txt +python -m unittest tests +``` + +## 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 From 18aeb880a050a3e0c7a2d5097ffd23c5bfc42883 Mon Sep 17 00:00:00 2001 From: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com> Date: Sat, 15 Oct 2022 08:28:14 -0700 Subject: [PATCH 3/7] Create requirements.txt --- Python/audiobook/requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 Python/audiobook/requirements.txt diff --git a/Python/audiobook/requirements.txt b/Python/audiobook/requirements.txt new file mode 100644 index 000000000..96cf83bea --- /dev/null +++ b/Python/audiobook/requirements.txt @@ -0,0 +1 @@ +audiobook==2.0.0 From 41bfc62c58ed51bebf0b1da409b5ce1153ccc8ab Mon Sep 17 00:00:00 2001 From: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com> Date: Sat, 15 Oct 2022 10:45:09 -0700 Subject: [PATCH 4/7] Update README.md --- Python/audiobook/README.md | 44 ++++---------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/Python/audiobook/README.md b/Python/audiobook/README.md index c7e84a609..71a61564a 100644 --- a/Python/audiobook/README.md +++ b/Python/audiobook/README.md @@ -6,6 +6,10 @@ Install using [pypi](https://pypi.org/project/audiobook/) pip install audiobook ``` +## Usages + +The audiobook is a python module for listening to your favourite PDF book. + ```python from audiobook import AudioBook ab = AudioBook(speed="normal") # argument: Speech-Speed="slow/normal/fast" @@ -14,23 +18,6 @@ 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. - -## Test - -Run tests: - -```sh -pip install -r requirements.txt -python -m unittest tests -``` - -## 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 : @@ -39,26 +26,3 @@ Read Detailed [Documentation here](https://audiobook.readthedocs.io/) ```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 From 0f2e9f4f78c9fd7e9e2a4f8e8203ba82cbf8fa94 Mon Sep 17 00:00:00 2001 From: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com> Date: Sun, 30 Oct 2022 20:48:02 -0700 Subject: [PATCH 5/7] Update script.py --- Python/audiobook/script.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Python/audiobook/script.py b/Python/audiobook/script.py index b8968b823..0883d2ae6 100644 --- a/Python/audiobook/script.py +++ b/Python/audiobook/script.py @@ -9,8 +9,7 @@ def read_book(input_file_path): """ if you want to read your book """ - ab.create_json_book(input_file_path) - + ab.read_book(input_file_path) def save_audio(input_file_path): """ if you want to save your audio books """ @@ -25,4 +24,4 @@ def save_audio(input_file_path): # full code: https://github.com/Py-Contributors/audiobook # Pypi: https://pypi.org/project/audiobook/ -# requirements.txt audiobook==2.0.0 +# requirements.txt audiobook==2.0.2 From babd8d857028ada13487cc3bdc5dfebc6940902f Mon Sep 17 00:00:00 2001 From: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com> Date: Sun, 30 Oct 2022 20:48:14 -0700 Subject: [PATCH 6/7] Update requirements.txt --- Python/audiobook/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/audiobook/requirements.txt b/Python/audiobook/requirements.txt index 96cf83bea..300b88974 100644 --- a/Python/audiobook/requirements.txt +++ b/Python/audiobook/requirements.txt @@ -1 +1 @@ -audiobook==2.0.0 +audiobook==2.0.2 From 1501e98a30ca80e1d89393a69102ac3172d612af Mon Sep 17 00:00:00 2001 From: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com> Date: Sun, 30 Oct 2022 20:51:15 -0700 Subject: [PATCH 7/7] Update README.md --- Python/audiobook/README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Python/audiobook/README.md b/Python/audiobook/README.md index 71a61564a..ee5eb93e6 100644 --- a/Python/audiobook/README.md +++ b/Python/audiobook/README.md @@ -8,14 +8,17 @@ pip install audiobook ## Usages -The audiobook is a python module for listening to your favourite PDF book. +The audiobook is also available as command line tool. -```python -from audiobook import AudioBook -ab = AudioBook(speed="normal") # argument: Speech-Speed="slow/normal/fast" +```bash +audiobook -h +``` +check [CLI Documentation ](https://audiobook.readthedocs.io/en/latest/index.html) + +## Run with this script -ab.save_audio(file_path, password=None) # save audio file -ab.read_book(file_path, password=None) # listen to the book +```bash +python script.py ``` ### Linux Installation Requirements