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

2.2.1 • 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.

Decoder's code is lazy: first run loads decoder's sources and compiles module before decoding.

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 @neoxr/audio-decode

Weekly Downloads

425

Version

2.2.1

License

MIT

Unpacked Size

34.7 kB

Total Files

11

Last publish

Collaborators

  • neoxr