All Projects → stojanovic → Lambda Audio

stojanovic / Lambda Audio

Licence: gpl-2.0
Run Sound eXchange (SoX), the Swiss Army knife of audio manipulation, with Lame on AWS Lambda

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Lambda Audio

Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-3.77%)
Mutual labels:  aws, serverless, lambda
Serverless Plugin Warmup
Keep your lambdas warm during winter. ♨
Stars: ✭ 814 (+1435.85%)
Mutual labels:  aws, serverless, lambda
Lambda Packages
Various popular python libraries, pre-compiled to be compatible with AWS Lambda
Stars: ✭ 713 (+1245.28%)
Mutual labels:  aws, serverless, lambda
Terraform Nextjs Plugin
A plugin to generate terraform configuration for Nextjs 8 and 9
Stars: ✭ 41 (-22.64%)
Mutual labels:  aws, serverless, lambda
Lamb
monitoring tool for better visibility when developing AWS Lambda functions
Stars: ✭ 11 (-79.25%)
Mutual labels:  aws, serverless, lambda
Aws Mobile React Sample
A React Starter App that displays how web developers can integrate their front end with AWS on the backend. The App interacts with AWS Cognito, API Gateway, Lambda and DynamoDB on the backend.
Stars: ✭ 650 (+1126.42%)
Mutual labels:  aws, serverless, lambda
Archive aws Lambda Go Shim
Author your AWS Lambda functions in Go, effectively.
Stars: ✭ 799 (+1407.55%)
Mutual labels:  aws, serverless, lambda
Webiny Js
Enterprise open-source serverless CMS. Includes a headless CMS, page builder, form builder and file manager. Easy to customize and expand. Deploys to AWS.
Stars: ✭ 4,869 (+9086.79%)
Mutual labels:  aws, serverless, lambda
Aws Lambda Workshop
Some incremental examples suitable to host an AWS Lambda Functions workshop
Stars: ✭ 18 (-66.04%)
Mutual labels:  aws, serverless, lambda
Lambdalogs
A CLI tool to trace AWS Lambda calls over multiple CloudWatch log groups.
Stars: ✭ 18 (-66.04%)
Mutual labels:  aws, serverless, lambda
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+15962.26%)
Mutual labels:  aws, serverless, lambda
Serverless Application Model
AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications
Stars: ✭ 8,305 (+15569.81%)
Mutual labels:  aws, serverless, lambda
Aws Sam Cli
CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
Stars: ✭ 5,817 (+10875.47%)
Mutual labels:  aws, serverless, lambda
Archive aws Lambda Go
A fast and clean way to execute Go on AWS Lambda.
Stars: ✭ 710 (+1239.62%)
Mutual labels:  aws, serverless, lambda
Dazn Lambda Powertools
Powertools (logger, HTTP client, AWS clients, middlewares, patterns) for Lambda functions.
Stars: ✭ 501 (+845.28%)
Mutual labels:  aws, serverless, lambda
Dawson Cli
A serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda)
Stars: ✭ 721 (+1260.38%)
Mutual labels:  aws, serverless, lambda
Aws Serverless Ecommerce Platform
Serverless Ecommerce Platform is a sample implementation of a serverless backend for an e-commerce website. This sample is not meant to be used as an e-commerce platform as-is, but as an inspiration on how to build event-driven serverless microservices on AWS.
Stars: ✭ 469 (+784.91%)
Mutual labels:  aws, serverless, lambda
Mangum
AWS Lambda & API Gateway support for ASGI
Stars: ✭ 475 (+796.23%)
Mutual labels:  aws, serverless, lambda
Aws Toolkit Vscode
AWS Toolkit for Visual Studio Code, an extension for working with AWS services including AWS Lambda.
Stars: ✭ 823 (+1452.83%)
Mutual labels:  aws, serverless, lambda
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-49.06%)
Mutual labels:  aws, serverless, lambda

SoX for AWS Lambda

Run Sound eXchange (SoX), the Swiss Army knife of audio manipulation, with Lame on AWS Lambda.

What

lambda-audio is static binary of sox utility, built for AWS Lambda. It supports sox, soxi and lame commands.

Why

lambda-audio allows you to covert and merge multiple audio files using AWS Lambda.

You can use it as a replacement/cheaper version of Amazon Elastic Transcoder. Or you can use it for the workflows that are not currently possible on Elastic Transcoder.

Motivation behind this library was a use case where we had up to five audio file that needs to be merged with specific rules — we need to put music in the background and different pauses between voice files. Service is used only from time to time, but we had instance for node.js app running all the time. This library is trying to solve that problem and allow us to do merging and conversion in AWS Lambda.

How

Installation

You can install this package from NPM by running following command:

npm install lambda-audio --save

Usage

After you require node module in your code by adding:

const lambdaAudio = require('lambda-audio')

lambdaAudio will contain three functions:

  • sox
  • soxi
  • lame

Each of the functions receives 1 argument that can be the string that contains the command or an array of attributes that needs to be passed to the command.

Each function is returning promise that will resolve when the command is successfully executed or has an error. Success answers will go to .then statement, errors will go to .catch statement. Response for both success and error will be passed as a string argument.

See below for the examples.

sox command

Let's say that you want to convert input.mp3 file to mono, and output it as output.wav file, in command line you would do that like this:

sox input.mp3 -c 1 output.wav

With lambda-audio you can do that by passing the command as a string, just without sox part, like this:

lambdaAudio.sox('./input.mp3 -c 1 /tmp/output.wav')
  .then(response => {
    // Do something when the file was converted
  })
  .catch(errorResponse => {
    console.log('Error from the sox command:', errorResponse)
  })

Or by passing the arguments as an array:

lambdaAudio.sox(['./input.mp3', '-c', '1', '/tmp/output.wav'])
  .then(response => {
    // Do something when the file was converted
  })
  .catch(errorResponse => {
    console.log('Error from the sox command:', errorResponse)
  })

Keep in mind that AWS Lambda is read only and that the output path needs to be in /tmp folder.

For the full list of options, visit sox documentation.

soxi command

Let's say that you want to see the info about input.mp3 file, in command line you would do that like this:

soxi input.mp3

With lambda-audio you can do that by passing the command as a string:

lambdaAudio.soxi('./input.mp3')
  .then(response => {
    // Do something with the info
  })
  .catch(errorResponse => {
    console.log('Error from the soxi command:', errorResponse)
  })

Or by passing the arguments as an array:

lambdaAudio.soxi(['./input.mp3'])
  .then(response => {
    // Do something with the info
  })
  .catch(errorResponse => {
    console.log('Error from the soxi command:', errorResponse)
  })

For the full list of options, visit soxi documentation.

lame command

Let's say you want to re-encode existing MP3 to 64 kbps MP3, in command line you would do it like this:

lame -b 64 input.mp3 output.mp3

With lambda-audio you can do that by passing the command as a string:

lambdaAudio.lame('-b 64 ./input.mp3 /tmp/output.mp3')
  .then(response => {
    // Do something with the new mp3 file
  })
  .catch(errorResponse => {
    console.log('Error from the lame command:', errorResponse)
  })

Or by passing the arguments as an array:

lambdaAudio.lame(['-b', '64', './input.mp3', '/tmp/output.mp3'])
  .then(response => {
    // Do something with the new mp3 file
  })
  .catch(errorResponse => {
    console.log('Error from the lame command:', errorResponse)
  })

For the full list of options, visit lame documentation.

Deployment

lambda-audio is working perfectly with Claudia.js library, but you can use it with other AWS Libraries and frameworks too.

With Claudia.js, simply save lambda-audio as a dependency and then you can deploy your AWS Lambda function using standard claudia create command.

Testing

We use Jasmine for unit and integration tests. Unless there is a very compelling reason to use something different, please continue using Jasmine for tests. The existing tests are in the spec folder. Here are some useful command shortcuts:

Run all the tests:

npm test

Run only some tests:

npm test -- filter=prefix

Get detailed hierarchical test name reporting:

npm test -- full

License

GNU GENERAL PUBLIC LICENSE, Version 2 -- see LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].