Skip to content

this code will help to read your pdf so that u ca relax and listen your book.

Notifications You must be signed in to change notification settings

ConfusedCoder23/text-to-speech.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

# text-to-speech.py
# install pyttsx3 and PyPDF2 from terminal section.
this code will help to read your pdf so that u ca relax and listen your book.
import pyttsx3
import PyPDF2
book = open('your pdf here.pdf', 'rb')
pdfReader = PyPDF2.PdfFileReader(book)
pages = pdfReader.numPages
print(pages)
speaker = pyttsx3.init()
page = pdfReader.getPage(page no.)
text = page.extractText()
speaker.say(text)
speaker.runAndWait()

About

this code will help to read your pdf so that u ca relax and listen your book.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published