From 2204570ab321673e731692c2a7d4fea7eef72c04 Mon Sep 17 00:00:00 2001 From: HARDIK KAUSHIK <58857069+hardikk2002@users.noreply.github.com> Date: Thu, 8 Oct 2020 23:35:42 +0530 Subject: [PATCH] Create PDF to audio book converter HEY THERE I wanted to add PDF to the audiobook converter in your repo. This file is very useful for the ones who are having difficulties in reading! This program is written in python If you like it then please accept my pull requestion : ) --- PYTHON/PDF to audio book converter | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 PYTHON/PDF to audio book converter diff --git a/PYTHON/PDF to audio book converter b/PYTHON/PDF to audio book converter new file mode 100644 index 0000000..df1107e --- /dev/null +++ b/PYTHON/PDF to audio book converter @@ -0,0 +1,12 @@ +import pyttsx3 +import PyPDF2 +book = open('book.pdf','rb') +pdfReader = PyPDF2.PdfFileReader(book) +number_of_pages = pdfReader.numPages +print(number_of_pages) +speaker = pyttsx3.init() +for num in range(1, number_of_pages): + page_number = pdfReader.getPage(10) + text = page_number.extractText() + speaker.say(text) + speaker.runAndWait()