Skip to content

Commit 87f85c1

Browse files
Add files via upload
1 parent 72886fc commit 87f85c1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

main.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pyttsx3
2+
import PyPDF2
3+
4+
#Add the name of the pdf book that needs to be read
5+
book = open('object_oriented_python_tutorial.pdf', 'rb')
6+
pdfReader = PyPDF2.PdfFileReader(book)
7+
pages = pdfReader.numPages
8+
print(pages)
9+
engine = pyttsx3.init()
10+
voices = engine.getProperty('voices')
11+
engine.setProperty('voice', voices[1].id)
12+
for num in range(7, pages):
13+
page = pdfReader.getPage(7)
14+
text = page.extractText()
15+
engine.say(text)
16+
engine.runAndWait()

object_oriented_python_tutorial.pdf

3.32 MB
Binary file not shown.

0 commit comments

Comments
 (0)