Skip to content

damiangs/python_audio_book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🎧 Python Audio Book Reader

Convert any PDF into an audiobook with this Python application! This tool can handle both text-based PDFs and scanned documents through OCR technology.

✨ Features

  • 📚 Read any PDF file (text-based or scanned)
  • 🔍 Automatic OCR for scanned documents
  • 🗣️ Text-to-Speech in Spanish
  • 🧹 Smart text cleaning for better audio output
  • 📱 Simple GUI for file selection
  • 🎯 Page-by-page reading

🚀 Requirements

Make sure you have Python installed and the following dependencies:

pip install pdfplumber pytesseract pdf2image gtts playsound

You'll also need:

  • Tesseract OCR installed on your system (for scanned documents)
  • poppler-utils (for PDF to image conversion)

💻 Installation

  1. Clone this repository or download the files
  2. Create a virtual environment:
    python -m venv venv
  3. Activate the virtual environment:
    • Windows:
      .\venv\Scripts\activate
    • Linux/Mac:
      source venv/bin/activate
  4. Install the required packages:
    pip install -r requirements.txt

🎮 Usage

  1. Run the script:
    python main.py
  2. Select your PDF file using the file dialog
  3. Wait while the program processes each page
  4. Listen to your document being read aloud!

⚙️ How it Works

  1. The program first attempts to extract text directly from the PDF
  2. If no text is found (scanned document), it automatically switches to OCR
  3. Text is cleaned and processed to remove unwanted characters and formatting
  4. Each page is converted to speech and played sequentially
  5. Temporary audio files are automatically cleaned up after playback

📝 Notes

  • The current version supports Spanish language text-to-speech
  • For OCR to work, make sure Tesseract is properly installed
  • Large PDFs may take longer to process, especially when OCR is needed

🤝 Contributing

Feel free to:

  • Open issues
  • Submit pull requests
  • Suggest improvements
  • Report bugs

📄 License

This project is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages