A modern web application that converts text files to natural-sounding speech using AWS Polly. Upload a .txt file, select a voice, and download the generated MP3 audio.
- 📄 Upload
.txtfiles (max 50 KB) - 🎙️ Choose from 8 AI voices (Joanna, Matthew, Ivy, Kendra, etc.)
- ⚡ Automatic text-to-speech conversion via AWS Lambda
- 🎧 Play and download generated MP3 audio
- 🌙 Clean dark theme UI
┌─────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Browser │────▶│ Flask App │────▶│ S3 Source │
│ │ │ (Python) │ │ Bucket │
└─────────────┘ └──────────────────┘ └────────┬────────┘
│
▼ (S3 Trigger)
┌─────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Browser │◀────│ Pre-signed URL │◀────│ Lambda + Polly │
│ (Download) │ │ │ │ │
└─────────────┘ └──────────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐
│ S3 Destination │
│ Bucket (.mp3) │
└─────────────────┘
Knoxify/
├── app.py # Flask backend
├── lambda_function.py # AWS Lambda function code
├── requirements.txt # Python dependencies
├── .env # Environment variables (not in repo)
├── .gitignore
├── templates/
│ └── index.html # Main UI template
├── static/
│ ├── css/style.css # Dark theme styles
│ └── js/main.js # Frontend logic
└── README.md
- AWS Account
- AWS CLI configured (optional)
Set your region to us-east-1 (N. Virginia) for all resources.
- Go to S3 → Create bucket
- Name:
knoxify-source-bucket - Region:
us-east-1 - Keep Block all public access enabled
- Click Create bucket
- Go to S3 → Create bucket
- Name:
knoxify-destination-bucket - Region:
us-east-1 - Keep Block all public access enabled
- Click Create bucket
- Go to IAM → Policies → Create policy
- Click JSON tab and paste:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:PutObject"],
"Resource": [
"arn:aws:s3:::knoxify-source-bucket/*",
"arn:aws:s3:::knoxify-destination-bucket/*"
]
},
{
"Effect": "Allow",
"Action": ["polly:SynthesizeSpeech"],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:*"
}
]
}- Name:
KnoxifyLambdaPolicy - Click Create policy
- Go to IAM → Roles → Create role
- Trusted entity: AWS service
- Use case: Lambda
- Attach policy:
KnoxifyLambdaPolicy - Name:
knoxify-lambda-role - Click Create role
- Go to Lambda → Create function
- Function name:
knoxify-text-to-speech - Runtime: Python 3.9
- Execution role: Use existing role →
knoxify-lambda-role - Click Create function
- Go to Configuration → Environment variables
- Add:
- Key:
DESTINATION_BUCKET - Value:
knoxify-destination-bucket
- Key:
- Copy the contents of
lambda_function.pyfrom this repo - Paste into the Lambda code editor
- Click Deploy
- Go to Configuration → General configuration
- Set timeout to 30 seconds
- In Lambda → Configuration → Triggers
- Click Add trigger
- Select S3
- Bucket:
knoxify-source-bucket - Event type: PUT
- Suffix:
.txt - Click Add
- Go to IAM → Users → Create user
- Name:
knoxify-app-user - Click Next
- Select Attach policies directly
- Attach:
AmazonS3FullAccessAmazonPollyFullAccess
- Click Create user
- Select the user → Security credentials tab
- Click Create access key
- Select Application running outside AWS
- Save the Access Key ID and Secret Access Key
git clone https://github.com/Rupeshs11/Knoxify.git
cd Knoxifypython -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
AWS_ACCESS_KEY_ID=your_access_key_here
AWS_SECRET_ACCESS_KEY=your_secret_key_here
AWS_REGION=us-east-1
SOURCE_BUCKET=knoxify-source-bucket
DESTINATION_BUCKET=knoxify-destination-bucket
SECRET_KEY=your-flask-secret-keypython app.pyOpen your browser to http://localhost:5000
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Homepage |
/upload |
POST | Upload text file + voice |
/status/<job_id> |
GET | Check processing status |
/download/<job_id> |
GET | Download audio (pre-signed URL) |
/voices |
GET | List available voices |
| Voice | Gender | Accent |
|---|---|---|
| Joanna | Female | US English |
| Matthew | Male | US English |
| Ivy | Female | US English (Child) |
| Kendra | Female | US English |
| Salli | Female | US English |
| Joey | Male | US English |
| Justin | Male | US English (Child) |
| Kevin | Male | US English (Child) |
- Frontend: HTML, CSS, JavaScript (Vanilla)
- Backend: Python, Flask
- Cloud: AWS S3, Lambda, Polly
- Auth: AWS IAM, Pre-signed URLs