/pdf2aud.py

This Python project offers a GUI-based solution for converting PDF files to audio and audio files to PDF. It leverages the power of Tkinter, OS, path, pyttsx3, SpeechRecognition, PyPDF4, and Pydub libraries, along with the messagebox module, to provide a user-friendly interface for seamless conversions.

Primary LanguagePython

PDF to AudioBook and Audio Speech to PDF using Python

Description

Welcome to our Python project, where we'll create a user-friendly GUI-based PDF to Audio and Audio to PDF converter using various libraries. This intermediate-level project allows you to apply your Python skills in real-life scenarios. Let's dive in and get started!

PDF to Audio Converters:

PDF to Audio Converters are capable of converting PDF text to speech.

In this project, we'll convert a single page of a PDF into speech, allowing you to hear it almost instantaneously.

Audio to PDF Converters:

Audio to PDF Converters transcribe an audio file into text, which can be added to an existing or new PDF.

In this project, you'll provide an audio file that we'll transcribe to text and add it to a PDF file. This is a speech-to-text conversion.

About the Project:

The objective of this project is to create a GUI-based PDF to Audio and Audio to PDF converter. You'll need an intermediate understanding of Tkinter, OS, path, SpeechRecognition, and PyPDF4 libraries, along with a basic understanding of Pydub and pyttsx3 libraries and the messagebox module.

Project Prerequisites:

To build this project, you'll need the following libraries:

  1. Tkinter: For creating the GUI.
  2. os.path: To retrieve the file name (with extension).
  3. PyPDF4.pdf:
    • PdfFileReader: To read text from the PDF.
    • PdfFileWriter: To add a new page to the PDF where text can be added.
  4. pyttsx3: To speak the text using the machine's speakers in an automated voice.
  5. SpeechRecognition: To transcribe speech in the audio file.
  6. path:
    • Path: To convert a string to the path of a file.
  7. pydub: For manipulating audio files.

This project will provide a valuable opportunity to enhance your Python skills while creating a useful tool for converting PDFs and audio files. Let's embark on this exciting journey!

Execute online

Visit here to test its working.



Running the Project Locally

To run this project on your local machine, follow the steps below:

  1. Ensure you have Python installed: This project requires Python, so make sure you have Python installed on your machine. You can download the latest version of Python from the official website (https://www.python.org/) and install it.

  2. Clone the repository: Clone this project repository to your local machine using Git or download the ZIP file and extract it.

  3. Install required libraries: Open your terminal or command prompt, navigate to the project directory, and run the following command to install the required libraries:

    pip install pyttsx3 SpeechRecognition PyPDF4 pydub
    

    If you encounter any issues with the installation, make sure you have pip (Python package manager) installed and up to date.

  4. Run the main.py script: In the project directory, you'll find the main.py script. Run the following command in your terminal or command prompt to execute the script:

    python main.py
    
  5. Wait for the GUI window to appear: After running the main.py script, the GUI window of the PDF to Audio and Audio to PDF converter will appear on your screen.

  6. Start converting: Now, you can use the converter to convert PDFs to audio or audio to PDF by following the on-screen instructions and options provided by the GUI.

Feel free to explore the features of the application and enjoy using this Python project to convert PDFs and audio files conveniently on your local machine!


Created with ❤️