Skip to main content

Create your own Audiobook from any PDF using Python

 



Are you bored of reading pdfs, soft copies, books? Then here's a solution, you can convert it into an Audiobook and Listen.

Let's get Started

First, we need to install the necessary libraries. We require two libraries to build Audiobooks using Python.

1. PyPDF2

A Pure-Python library built as a PDF toolkit. It is capable of extracting document information splitting documents page by page merging documents page by page cropping pages merging multiple pages into a single page encrypting and decrypting PDF files and more!

So open your terminal and run the following command. 

pip install PyPDF2

2. Pyttsx3

pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline and is compatible with both Python 2 and 3.

So open your terminal and run the following command.

pip install pyttsx3

Now here the code for it.

import pyttsx3 import PyPDF2 book_name = open('harrypotter.pdf','rb') pdf_reader = PyPDF2.PdfFileReader(book_name) pages = pdf_reader.numPages play = pyttsx3.init() print('playing....') for num in range(0,pages): page = pdf_reader.getPage(num) text = page.extractText() play.say(text) play.runAndWait()




Comments

Popular posts from this blog

What is ARP Monitor?

ARP MONITOR It’s FREE  tool like arpwatch but for Windows OS. This tool can help with ARP activity monitoring in computer networks.   It allows you to catch intruders on the network, track MAC-IP bundles, detect scans, monitor real-time ARP protocol activity in the segment, and much more. This windows software monitors ethernet activity like unix apwatch and keeps a database of ethernet/ip address pairings. new activity - This ethernet/ip address pair has been used for the first time. new station - The ethernet address has not been seen before. flip flop - The ethernet address has changed from the most recently seen address to the second most recently seen address. changed ethernet address - The host switched to a new ethernet address.  Download :   Mirror: http://www.binaryplant.com/binaryplant-arp-monitor.exe

Microsoft showing of its new xbox one dashboard

Microsoft revealed last week that it’s planning to  rebuild the Xbox One dashboard  with a focus on speed. While the software giant revealed common tasks will be faster, Mike Ybarra, head of platform engineering for Xbox, has now teased exactly what the new dashboard will look like. Microsoft is adding a new Xbox button part of the guide that slides into view, with the ability to quickly switch between recent apps or games without having to navigate back to the home of the dashboard. This subtle change could speed up the Xbox One dashboard significantly. One of the big issues of the current guide is heading back to home and watching the entire system slow down and lag, or refresh randomly. The new guide is accessible with a single button press, and it appears the old home concept will be replaced entirely with this quicker method. That should make the Xbox One guide a lot more like the Xbox 360 version, and just easier to use in general.  Windows Central  has captured the brief demo o