JSPM

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

Decode audio data in node or browser

Package Exports

  • audio-decode
  • audio-decode/audio-decode.js

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 test stable

Decode audio data from supported format to AudioBuffer.

Supported formats:

  • wav
  • mp3
  • ogg vorbis
  • flac
  • opus
  • alac
  • aac
  • m4a
  • qoa

npm install audio-decode

import decodeAudio from 'audio-decode';
import buffer from 'audio-lena/mp3';

let audioBuffer = await decode(buffer);

buffer type can be: ArrayBuffer, Uint8Array or Buffer.

decode is lazy: first call prepares decoder.

To get more granular control over individual decoders, use decoders:

import decode, {decoders} from 'audio-decode';

await decoders.mp3(); // load & compile decoder
const audioBuffer = await decoders.mp3(mp3buf); // decode

See also

License

MIT  •  🕉