Giter VIP home page Giter VIP logo

aud.io's Introduction

aud.io

Run FFmpeg jobs on demand with aud.io! This project implements a plain Node.JS HTTP server hosted on Heroku Dynos. It accepts audio media in the form of download links or file streamed POSTed as a part of multipart form data (making it a convenient plugin API for frontend and backends alike). Response can be accepted as a JSON with a download URL or a file stream. Download URLs are provided courtesy a presigned AWS S3 file URL with default expiration. All requests are GZIP compressed and cached in S3, and all download URLs responses are GZIP compressed. The minimal NPM dependencies allows this project to be fast and relatively portable.

Design Logic Diagram

Design Logic Diagram

Input a download URL and stream out to an output file

curl https://aud-i0.herokuapp.com/?url=https%3A%2F%2Fwww.bensound.com%2Fbensound-music%2Fbensound-ukulele.mp3 >> normalized_audio.mp3

Input a download URL and receive a JSON w/ a presigned URL to download from S3

curl -X GET 'https://aud-i0.herokuapp.com/?url=https%3A%2F%2Fwww.bensound.com%2Fbensound-music%2Fbensound-slowmotion.mp3&presignRes=true'

Stream an input file and stream out to an output file

curl -X POST -H "Content-Type: multipart/form-data" -F "file=@./audio.mp3" -F "type=audio/mpeg" https://aud-i0.herokuapp.com >> normalized_audio.mp3

Stream an input file and receive a JSON w/ a presigned URL to download from S3

curl -X POST -H "Content-Type: multipart/form-data" -F "file=@./audio.mp3" -F "type=audio/mpeg" -F "presignRes=true" https://aud-i0.herokuapp.com

Input a download URL and stream out to an output file

curl -X POST -H "Content-Type: multipart/form-data" -F "url=https://www.bensound.com/bensound-music/bensound-hey.mp3" https://aud-i0.herokuapp.com >> normalized_audio.mp3

Input a download URL and receive a JSON w/ a presigned URL to download from S3

curl -X POST -H "Content-Type: multipart/form-data" -F "url=https://www.bensound.com/bensound-music/bensound-hey.mp3" -F "presignRes=true" https://aud-i0.herokuapp.com

Options / Arguments

All arguments accepted via query, params or body data. The following FFmpeg options are supported explicitly with equivalent plain-text key names:

input/inputUrl/url - Input download URL for audio file (REQUIRED if no file streamed as form POST data)
I/integratedLoudness - Integrated Loudness (default: -14)
TP/truePeak - Inter-sample peak (default: -3)
LRA/loudnessRange - Loudness Range from softest to loudest (default: 11)
af - audio filter (optional / default: loudnorm=I=${i}:TP=${tp}:LRA=${lra}:print_format=json)
bitRate - Audio Bit Rate (bits per unit time) (optional)
presignRes/presignResponse - returns pre-signed S3 download URL if equal to true (default: false - streams file to response)

Defaults based on normalization required for Amazon Alexa:
https://developer.amazon.com/en-US/docs/alexa/flashbriefing/normalizing-the-loudness-of-audio-content.html#additional-tools
Other FFmpeg options are implicitly supported by their key name as documented here:
https://ffmpeg.org/ffmpeg.html#toc-Options

Technologies

Node.JS (HTTP/HTTPS, crypto, stream, zlib), Heroku, AWS S3, FFmpeg

Dependencies

aws-sdk, busboy, @discordjs/opus, ffmpeg-static, loglevel, prism-media

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.