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.
- 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
- Python 3.13+
- AWS account with Polly access and credentials
- The following Python packages (see pyproject.toml):
- Flask
- Flask-Bootstrap
- boto3
- PyPDF2
- python-dotenv
-
Clone the repository and navigate to the project directory.
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables: Create a
.envfile 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
-
Create the uploads directory:
mkdir uploads
-
Run the application:
python [app.py]
-
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.
- 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
- This project is for educational purposes.

