0

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?

Ted Klein Bergman
  • 9,146
  • 4
  • 29
  • 50
  • 1
    It would be helpful if you identify which line is causing the segmentation fault. – Ted Klein Bergman Mar 27 '21 at 11:19
  • This is what a segmentation fault is: https://stackoverflow.com/q/2346806/6486738. However, it's not something that's going to help you in this case. You've probably used the library wrong or there's a bug in it. – Ted Klein Bergman Mar 27 '21 at 11:20

0 Answers0