I'm trying to build text speaking app with Python. Here this is my code:
import pyttsx3
import PyPDF2
book=open("LifesAmazingSecets.pdf",'rb')
pdfReader=PyPDF2.PdfFileReader(book)
pages=pdfReader.numPages
print(pages)
engine = pyttsx3.init()
page=pdfReader.getPage(155)
text=page.extractText()
engine.say(text)
engine.runAndWait()
I'm trying to run this code but I get this error:
Segmentation fault
What is Segmentation fault and how do I recover from it?