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

2.2.2 • 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  •  🕉

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.2.2241,087latest

Version History

VersionDownloads (Last 7 Days)Published
2.2.2241,087
2.2.1497
2.2.08,866
2.1.722
2.1.62
2.1.54,747
2.1.444,386
2.1.31,685
2.1.24
2.1.16
2.1.03
2.0.24
2.0.14
2.0.01
1.4.0506
1.3.17
1.3.02
1.2.61
1.2.53
1.2.42
1.2.33
1.2.21
1.2.11
1.2.04
1.1.01
1.0.33
1.0.22
1.0.13
1.0.02

Package Sidebar

Install

npm i audio-decode

Weekly Downloads

301,855

Version

2.2.2

License

MIT

Unpacked Size

34.7 kB

Total Files

11

Last publish

Collaborators

  • dfcreative
  • jamen
  • dy