Skip to content

sudonitin/Audio-book-generator

Repository files navigation

Implementing speech synthesis(๐Ÿ“– to ๐Ÿ—ฃ) on eBooks

Bored of writing notes in a lecture? How about we convert the notes dictated by the lecturer into text? Use the speechtotext.py script to get the text format of spoken notes, which saves the text in a .txt file.
Too lazy to read a novel? Get an Ebook version of the novel and run the finalAudioBookGenerator.py script. It will generate an mp3(audio) format of the book. Enjoy book listening :)
You can also convert your single images using singleImageReader.py script

An example of each of the script is shown, the text from spoken text.PNG was delivered by me, observe the s2txt.txt it is the output (accurate to a great extent if you have a decent english speaking accent)
Listen to the read.mp3 and observe the page numbers which are spoken from the pdf file. (eg of ebook reader)

Prerequisite

For Windows Users

  • Install tesseract from here.
  • Add tesseract to your environment variable. (Add this path C:\Program Files (x86)\Tesseract-OCR)
  • Type 'tesseract' in cmd you will get a lot of options like this.
  • (Optional: This step should be done only if you get an error which gives the below error )Add a new variable in environment variable TESSDATA_PREFIX and give it C:\Program Files (x86)\Tesseract-OCR\tessdata this value.
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.

For Linux Users

How to run:

NOTE: You need to complete the steps mentioned in Prerequisite.

Run these commands in cmd/terminal of a directory

git clone https://github.com/globefire/Audio-book-generator.git
cd speech-recognition-Ebook-Reader
pip install -r requirements.txt
python speechtotext.py
python finalAudioBookGenerator.py

Watch the demonstration

Support Me

If you liked this Repository, then please leave a star on this repository. It motivates me to contribute more in such Open Source projects in the future.

Happy Coding =)