Nitwix / pdf2speech

Simple python application to read pdf's out loud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pdf2speech

Simple python application to read pdf's out loud

Usage

usage: pdf2speech.py [-h] [--first_page FIRST_PAGE] [--speed SPEED] [--chunk_size CHUNK_SIZE] [--engine {espeak,mimic3}] filename

Listen to PDF files using text-to-speech

positional arguments:
  filename              PDF filename

optional arguments:
  -h, --help            show this help message and exit
  --first_page FIRST_PAGE
                        First page number
  --speed SPEED         Speech speed (words per minute)
  --chunk_size CHUNK_SIZE
                        Text chunks size
  --engine {espeak,mimic3}
                        Engine used for TTS

Example: python pdf2speech.py test_data/pg11.pdf

Requirements

  • pdftotext, install package poppler-utils on linux.
  • krop if --two_columns option needed
  • espeak, install package espeak on linux.
  • mimic3 better sounding alternative to espeak, easy to use via docker. See also mimic3-server script to run the server more easily.
  • aplay, install package alsa-utils on linux.

Note

This project was developed in a few hours of my spare time. If someone wants to build on this and maybe submit pull requests to improve it, I'm happy to take a look at it.

About

Simple python application to read pdf's out loud

License:GNU General Public License v3.0


Languages

Language:Python 100.0%