Skip to content

PDF Story is a Python project that converts PDF text to speech and saves it as an MP3 file.

Notifications You must be signed in to change notification settings

Bisharsh/pdf-story

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

PDF Story

PDF Story is a Python project that converts PDF text to speech and saves it as an MP3 file.

Usage

import pyttsx3
import PyPDF2

# Insert name of your PDF
pdfreader = PyPDF2.PdfFileReader(open('book.pdf', 'rb'))
speaker = pyttsx3.init()

for page_num in range(pdfreader.numPages):
    text = pdfreader.getPage(page_num).extractText()
    clean_text = text.strip().replace('\n', ' ')
    print(clean_text)
# Name MP3 file whatever you would like
speaker.save_to_file(clean_text, 'story.mp3')
speaker.runAndWait()

speaker.stop()

About

PDF Story is a Python project that converts PDF text to speech and saves it as an MP3 file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages