Skip to content

shaunak012/TTS-using-Polly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗣️ Text-to-Speech API using AWS Lambda, Polly, and S3

This project converts input text to speech using Amazon Polly and securely returns a pre-signed URL to the generated MP3 audio.

🚀 Tech Stack

  • 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

🧠 How It Works

  1. You send a POST request to the API with some text
  2. Lambda triggers Polly to convert it into speech
  3. The resulting MP3 file is uploaded to S3
  4. A secure, short-lived pre-signed URL is returned
  5. You can click the URL to hear the voice output 🎧

🔐 API Security

  • The API is secured using an API Key
  • Only requests with the correct x-api-key header are allowed
  • Audio files in S3 remain private, accessed only via pre-signed URLs

📬 Example Request

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=..."
  }

📺 Demo Video

A video walkthrough of the project, live API calls, and how the secure pre-signed URLs work : Demo Video


📜 License

This project is open-source and intended for educational and personal portfolio use.


✨ Author

Shaunak Shukla
LinkedIn

About

A cloud-based Text-to-Speech service using AWS Lambda and Amazon Polly. Converts text input into natural-sounding speech in real time.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages