audio-decode
TypeScript icon, indicating that this package has built-in type declarations

2.2.3 • Public • Published

audio-decode test stable

Decode audio data from supported format to AudioBuffer.

Supported formats:

  • [x] wav
  • [x] mp3
  • [x] ogg vorbis
  • [x] flac
  • [x] opus
  • [ ] alac
  • [ ] aac
  • [ ] m4a
  • [x] 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  •  🕉

Package Sidebar

Install

npm i audio-decode

Weekly Downloads

253,108

Version

2.2.3

License

MIT

Unpacked Size

34.8 kB

Total Files

12

Last publish

Collaborators

  • dfcreative
  • jamen
  • dy