how to make a audiobook in python
#pip pyttsx3 and PyPDF2
#import the pdf you want to read
import pyttsx3
import PyPDF2
book = open('Pdf Name', 'rb')
pdfReader = PyPDF2.PdfFileReader(book)
pages = pdfReader.numPages
print(pages)
speaker = pyttsx3.init()
#0 the first page and pages about all pages so if you change 0 in both page and for loop it will work
for num in range(0, pages):
page = pdfReader.getPage(0)
text = page.extractText()
speaker.say(text)
print(text)
speaker.runAndWait()