1

We are using AWS serverless architecture for our Contact center. We are storing audio recordings on S3 bucket and using lambda functions to process them. Our requirement is to remove sensitive details from audio recording such as Payment information. So we need to fetch audio recording from S3 bucket and slice that using start time and duration for sensitive payment details and then join remaining recording clips into one.

How can we achieve this by using AWS lambda(NodeJS/Python), S3?

Thanks, Ganesh

gans2910
  • 51
  • 2

1 Answers1

0

I did not try this myself yet, but I'd use the lambda-audio package, which contains SoX, a swiss army knife for sound files and then run the trim command as described here.

Here is some code to get you started:

lambdaAudio.sox('./input.mp3 /tmp/output.wav trim 0 10')
  .then(response => {
    // Do something when the first 10 seconds of the file have been extracted
  })
  .catch(errorResponse => {
    console.log('Error from the sox command:', errorResponse)
  })
Maurice
  • 11,482
  • 2
  • 25
  • 45