TGViewer
Channel Public Channel
Python Projects & Free Books

Python Projects & Free Books

@pythonfreebootcamp

Python Interview Projects & Free Courses

Admin: @Coderfun
Subscribers
40.6K
Photos
655
Videos
1
Links
301

Showing posts older than #238 ยท Back to latest

Older Posts 14 shown
Post #215 19.9K
pip install PyPDF2
pip install pyttsx3


```python
import PyPDF2
import pyttsx3
# Read the pdf by specifying the path in your computer
pdfReader = PyPDF2.PdfFileReader(open('clcoding.pdf', 'rb'))
# Get the handle to speaker
speaker = pyttsx3.init()
# split the pages and read one by one
for page_num in range(pdfReader.numPages):
text = pdfReader.getPage(page_num).extractText()
speaker.say(text)
speaker.runAndWait()
# stop the speaker after completion
speaker.stop()
# save the audiobook at specified path
engine.save_to_file(text, 'E:\audio.mp3')
engine.runAndWait()`

๐Ÿ”… Create an Audiobook in Python
  • ๐Ÿ‘ 57
  • ๐Ÿ‘Ž 1
Older posts โ†’
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’