Skip to content

About

PDF to audio converter is a Flask web application that allows users to upload PDF files and convert them into audio (MP3) files using AWS Polly. The app extracts text from uploaded PDFs, splits the text into manageable parts, and generates downloadable audio files in the selected voice.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PDF to audio converter

PDF to audio converter is a Flask web application that allows users to upload PDF files and convert them into audio (MP3) files using AWS Polly.
The app extracts text from uploaded PDFs, splits the text into manageable parts, and generates downloadable audio files in the selected voice.

Features

  • Upload PDF files and convert them to audio (MP3)
  • Choose from multiple AWS Polly voices (Male, Female)
  • Download generated audio files directly from the web interface
  • Responsive UI styled with Bootstrap 5

Requirements

  • Python 3.13+
  • AWS account with Polly access and credentials
  • The following Python packages (see pyproject.toml):
    • Flask
    • Flask-Bootstrap
    • boto3
    • PyPDF2
    • python-dotenv

Setup

  1. Clone the repository and navigate to the project directory.

  2. Install dependencies:

    pip install -r requirements.txt
  3. Configure environment variables: Create a .env file in the project root and add your configuration:

    FLASK_KEY=your_flask_secret_key
    UPLOAD_FOLDER=absolute/path/to/uploads
    AWS_ACCESS_KEY_ID=your_aws_access_key
    AWS_SECRET_ACCESS_KEY=your_aws_secret_key
  4. Create the uploads directory:

    mkdir uploads
  5. Run the application:

    python [app.py]
  6. Usage Instructions

  • Upload a PDF file (max 8MB) and Select your preferred voice.
  • Click "Upload" to convert.
  • Download the generated audio files from the redirected page.
  1. File Structure
  • app.py - Main Flask application
  • pdf_to_audio.py - PDF text extraction and AWS Polly integration
  • templates/ - HTML templates for the web interface
  • uploads/ - Directory for storing uploaded PDFs and generated audio files

Screenshots

Home Page

Home Page

Downloads Page

Downloads

License

  • This project is for educational purposes.

About

PDF to audio converter is a Flask web application that allows users to upload PDF files and convert them into audio (MP3) files using AWS Polly. The app extracts text from uploaded PDFs, splits the text into manageable parts, and generates downloadable audio files in the selected voice.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages