This project converts input text to speech using Amazon Polly and securely returns a pre-signed URL to the generated MP3 audio.
- AWS Lambda – Serverless compute
- Amazon Polly – Neural text-to-speech engine
- Amazon S3 – Private audio storage
- API Gateway (REST) – Secured public endpoint
- API Key – Restricts access to only approved clients
- You send a POST request to the API with some text
- Lambda triggers Polly to convert it into speech
- The resulting MP3 file is uploaded to S3
- A secure, short-lived pre-signed URL is returned
- You can click the URL to hear the voice output 🎧
- The API is secured using an API Key
- Only requests with the correct
x-api-keyheader are allowed - Audio files in S3 remain private, accessed only via pre-signed URLs
POST /generate-audio
Headers:
Content-Type: application/json.
x-api-key: YOUR_API_KEY
Body:
{
"text": "Hello world!"
}
Response:
{
"audioUrl": "https://your-bucket.s3.amazonaws.com/audio_xyz123.mp3?AWSAccessKeyId=..."
}A video walkthrough of the project, live API calls, and how the secure pre-signed URLs work : Demo Video
This project is open-source and intended for educational and personal portfolio use.
Shaunak Shukla
LinkedIn