how to make your own audio book reader using python

Solutions on MaxInterview for how to make your own audio book reader using python by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "how to make your own audio book reader using python"
Giuseppe
18 Jun 2020
1import pyttsx3
2import PyPDF2
3
4book = open("File Name document","rb")
5pdfreader = PyPDF2.PdfFileReader(book)
6pages_in_book = pdfreader.numPages
7for num in range(0,pages_in_book):
8    page = pdfreader.getPage(num)
9    text = page.extractText()
10    speeaker = pyttsx3.init()
11    speeaker.say(text)
12    speeaker.runAndWait()
13#output
14#python will start reading your document