Giter VIP home page Giter VIP logo

audio-decode's Introduction

audio-decode Build Status unstable Greenkeeper badge

Convert mp3/wav audio data to AudioBuffer.

npm install audio-decode

const decode = require('audio-decode');
const buffer = require('audio-lena/mp3');

//as a callback
decode(buffer, (err, audioBuffer) => {});

//as a promise
decode(buffer).then(audioBuffer => {}, err => {});

API

let promise = decode(source, {context}?, (err, audioBuffer)=>{}?)

Decode source, based on options and fire callback when done, or resolve a promise if no callback passed. Source type can be: ArrayBuffer, ArrayBufferView, Buffer, Blob, File or data-uri string.

options may include context property for web-audio-api context (browser-only). By default new audio-context is created.

Supported formats

Browser version uses decodeAudioData method, in node the aurora is used.

Shipped by default:

To enable additional format, install it as a dependency npm install --save flac.js and require once require('flac.js').

Additional formats available:

// Decode flac
let decode = require('audio-decode')
let flac = require('audio-lena/flac')
require('flac.js')

decode(flac).then(audioBuffer => {
	//buffer is ready here
})

Credits

Related

License

MIT © audiojs.

audio-decode's People

Contributors

dy avatar greenkeeper[bot] avatar jamen avatar alexanderwallin avatar misogihagi avatar

Watchers

James Cloos avatar

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.