Skip to content

Instantly share code, notes, and snippets.

@AIAnytime
Last active February 19, 2021 06:07
Show Gist options
  • Save AIAnytime/38677d3985e5b13061419b21587d2ccc to your computer and use it in GitHub Desktop.
Save AIAnytime/38677d3985e5b13061419b21587d2ccc to your computer and use it in GitHub Desktop.
Convert PDF File text to audio speech using Python
import pyttsx3
import PyPDF2
path = open('resume.pdf', 'rb')
pdf_reader = PyPDF2.PdfFileReader(path)
from_page = pdfReader.getPage(0)
text = from_page.extractText()
speak = pyttsx3.init()
speak.say(text)
speak.runAndWait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment