JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 104176
  • Score
    100M100P100Q163296F
  • License MIT

Decode audio data in node or browser

Package Exports

  • audio-decode

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (audio-decode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

audio-decode Build Status unstable Greenkeeper badge

Convert ArrayBuffer with audio encoded in any format to AudioBuffer. Basically context.decodeAudioData for node and browser.

npm install audio-decode

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

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

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

API

let promise = decode(arrayBuffer, options?, callback?)

Decode array buffer, based on options maybe and pass data to the callback when done, or resolve a promise if no callback passed.

Possible options may include context property for web-audio-api context. If not defined, the audio-context will be used.

Supported formats

Shipped by default:

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

Credits