Page:
Home
Pages
Design da
Design ms
Design
Home da
Home ms
Home
Reflection da
Reflection ms
Reflection
Step 1 Environment da
Step 1 Environment ms
Step 1 Environment
Step 2 Read the PDF da
Step 2 Read the PDF ms
Step 2 Read the PDF
Step 3 Speak with Coqui TTS da
Step 3 Speak with Coqui TTS ms
Step 3 Speak with Coqui TTS
Step 4 Convert and Command Line da
Step 4 Convert and Command Line ms
Step 4 Convert and Command Line
Step 5 Tests and Quality da
Step 5 Tests and Quality ms
Step 5 Tests and Quality
Step 6 Speak Text Window da
Step 6 Speak Text Window ms
Step 6 Speak Text Window
Step 7 Open PDF in the Window da
Step 7 Open PDF in the Window ms
Step 7 Open PDF in the Window
Clone
3
Home
Tirsvad edited this page 2026-11-20 16:43:09 +01:00
Table of Contents
English · Dansk · Bahasa Malaysia
PDF to Audiobook
A small Python 3.13 program that reads a PDF file and turns its text into speech, so you get a free audiobook. It is the Day 91 assignment of the Udemy course 100 Days of Code: The Complete Python Pro Bootcamp.
The assignment suggests paid text-to-speech web services. This project pays for nothing: it uses Coqui TTS, an open source speech engine that runs on your own machine.
The five lecture steps
Each step has a page that shows a screenshot and explains what we gained.
| Step | Page | What it is |
|---|---|---|
| 1 | Step 1: Environment | A local .venv, pip upgraded, the project installed |
| 2 | Step 2: Read the PDF | Extract the text and split it into pieces |
| 3 | Step 3: Speak with Coqui TTS | Turn one piece of text into audio |
| 4 | Step 4: Convert and command line | The whole conversion from a terminal |
| 5 | Step 5: Tests and quality | Tests, types, style and the security scan |
| 6 | Step 6: Speak text window | Type text and hear it through the speakers |
| 7 | Step 7: Open a PDF in the window | Open a PDF and hear it, with a Stop button |
Also read Design for how the code is layered and Reflection for what we learned.
Quick start
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pdf_to_audiobook tests/data/sample.pdf -o build/sample.wav
The first install and the first run download several hundred megabytes (PyTorch and the voice model).