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