Convert your Audio files to text using AWS Transcribe and Step Functions

Peter Eskandar
2 min readJan 20, 2021

--

Hi all,

I’ve realized a simple demo App that converts audio files to text and sends results by email to the user.

App Workflow

Overview of the App components & workflow :

  • a WebApp in Angular which allows the user to upload an audio file and insert his/her email address to be able to receive the results.
  • AWS Cognito (to allow unauthenticated users to be able to interact with AWS Services)
  • S3 Bucket where all uploaded files will be stored
  • a Lambda function which will be triggered by S3 on each file upload.
  • State Machine composed of multiple Lambda functions and will be triggered by the Lambda function in the previous step on each file upload, receiving information of the recently uploaded file (bucket name & object key).
  • SES Domain Identity : actually in my case I preferred SES over SNS to be able to send emails without asking for email verification (this could be done only with SES in production mode).

State Machine :

State Machine Workflow

State Machine/Step Functions is a serverless orchestration service that lets you easily coordinate multiple Lambda functions into flexible workflows that are easy to debug and easy to change.

Our State Machine will orchestrate multiple Lambda functions doing the following tasks (in order) :

  • Transcribe : on each file upload, this Lambda function will start a new Transcription job using AWS Transcribe service.
Transcription job
  • Transcribe Wait : this Lambda function will check the status of the Transcription job created on the previous step every 2 seconds, once completed the status and the job results will be communicated to the next step.
  • Transcribe Complete : based on the Transcription job status communicated by the previous Lambda function, in this step we are going to add a new variable to the payload for the next steps ($.Payload.TranscriptionJobStatus).

This variable will indicate the final status of our Transcription job

  • Delete Transcription job : in this final step, we are going to send an email to the user with the Transcription job results and delete the Transcription job from AWS Transcribe service.

here is the full configuration of our State Machine

State Machine Configuration

Remember to give all your Lambda functions the required roles to be able to communicate with the other services for example (S3, AWS Transcribe & SES/SNS)

--

--