🎧 AWS Audio Transcription Automation with CloudFormation

🎧 AWS Audio Transcription Automation with CloudFormation

Welcome to the AWS Audio Transcription Automation undertaking! This CloudFormation stack automates transcription of audio recordsdata (MP4, MP3, and WAV) utilizing Amazon Transcribe. Easily add your audio recordsdata to S3, set off transcription jobs, and retailer leads to an output S3 bucket — all automated! 🎉

Architecture Diagram

Transcription Diagram drawio (1)

🚀 Features

  • Automatic Transcription: Supports MP4, MP3, and WAV audio recordsdata, utilizing Amazon Transcribe.
  • Secure Storage: AES-256 encryption for S3 buckets.
  • Lifecycle Management: Automatically expire enter recordsdata after 1 day and log recordsdata after 2 days.
  • Logging: Logs Lambda operate execution and S3 entry.
  • Event-Driven Transcription: Automatically triggers transcription jobs upon file add.
  • Final HTML Output: Transcription outcomes are processed into an HTML file, viewable on any browser for straightforward studying.

🛠️ Technology Stack

  • Amazon S3: Storage for audio recordsdata, transcription outcomes, and entry logs.
  • AWS Lambda: Event-driven operate to set off transcription jobs.
  • Amazon Transcribe: Speech-to-text transcription service.
  • Amazon CloudWatch: Logs Lambda operate exercise.
  • IAM Roles: Manages permissions for Lambda and S3.

🎯 How It Works

  1. Upload audio recordsdata (MP4, MP3, or WAV) to the designated S3 enter bucket.
  2. Lambda Triggered: Upon add, a Lambda operate triggers an Amazon Transcribe job.
  3. Transcription Results: Transcription outcomes are saved within the specified S3 output bucket, and formatted as an HTML file for straightforward viewing.

🧩 CloudFormation Resources

This CloudFormation stack provisions the next assets:

  • Input S3 Bucket: For audio recordsdata awaiting transcription.
  • Output S3 Bucket: Stores accomplished transcription outcomes.
  • Logging S3 Bucket: Logs entry occasions for each enter and output buckets.
  • AWS Lambda Function: Automatically triggers transcription jobs.
  • IAM Role: Provides obligatory permissions for the Lambda operate.
  • CloudWatch Log Group: Logs Lambda operate execution.

📦 Installation & Setup

Prerequisites

  1. AWS CLI: Installed and configured in your native machine.
  2. AWS Account: Ensure permissions to create CloudFormation stacks, Lambda capabilities, and S3 buckets.
  3. Edit Deploy File: Edit the STACK_NAME fixed to a novel identify within the deploy-transcription.sh file. Update the area within the s3-trigger.sh file in case your area isn’t us-east-1.

Deploy the Stack

  1. Clone the repository:
   git clone https://github.com/Warner-Bell/audio-transcription-build.git
   cd audio-transcription-automation

Update the s3-trigger.sh file with you stack identify

  1. Run the deployment script:
   ./bin/deploy-transcription.sh

This script deploys the CloudFormation stack utilizing a template file, establishing the required S3 buckets, Lambda operate, and permissions.

  1. Deploy S3 Trigger for Lambda:
    After deploying the CloudFormation stack, arrange the S3 bucket set off utilizing s3-trigger.sh:
   ./bin/s3-trigger.sh

Note: The S3 set off configuration script (s3-trigger.sh) is created as a separate script to keep away from round dependencies between the S3 bucket, Lambda operate, and logging configuration.

  1. Verify Deployment: Monitor the deployment progress within the AWS CloudFormation Console to make sure all assets are created efficiently.

  2. Start Transcribing: Once deployed, merely add audio recordsdata to the designated enter S3 bucket to begin transcription. After working the S3 bucket set off, add your recordsdata to S3 utilizing upload-to-s3.sh (Edit the file variables along with your data.)

   ./bin/upload-to-s3.sh

Note on Output: Transcription output recordsdata are saved in each JSON and HTML format within the output S3 bucket. The HTML format might be considered immediately in any internet browser for straightforward studying, eliminating the necessity to manually copy textual content from JSON recordsdata.

📂 Project Structure

.
├── audio-samples        # 3 pattern audio recordsdata in mp3, mp4, and wav format
├── bin/
│   ├── deploy-transcription.sh # Deployment script
│   ├── empty-buckets.sh        # Empty all Project Buckets
│   ├── s3-trigger.sh           # Lambda function configuration and S3 bucket notifications
│   ├── upload-to-s3.sh         # Upload chosen audio file to s3
├── cfn/audio-transcription.yaml         # CloudFormation template
├── README.md                   # Project documentation

📊 Monitoring & Logging

  • CloudWatch Logs: View Lambda execution logs within the AWS CloudWatch console.
  • S3 Access Logs: Access logs for enter and output S3 buckets are saved within the logging bucket.

⚙️ Recommended Practices

  • Adjust Bucket Retention: Modify lifecycle insurance policies to fit your knowledge retention necessities.
  • Configure Notifications: Install and configure notify-send on Linux for deployment notifications (non-compulsory).
  • Review IAM Policies: Ensure permissions are as restrictive as doable for manufacturing use.

🤝 Contributing

We welcome contributions! To contribute, comply with these steps:

How to Contribute

  1. Fork the repo 🍴
  2. Create a brand new department:
   git checkout -b function/awesome-feature
  1. Commit your modifications 💻
  2. Push your department and submit a PR 🛠️

🌍 License

This undertaking is licensed beneath the MIT License. See the LICENSE file for particulars.

🏆 Acknowledgements

  • Thanks to AWS for his or her sturdy providers. 💪
  • Special because of OpenAI for uplifting innovation with AI-based instruments. 🙌

📬 Contact

Warner Bell – Tap In!

✨ Happy Transcribing! ✨

HI-FI News

through DEV Community https://dev.to

November 9, 2024 at 06:09PM