Socket
Book a DemoInstallSign in
Socket

audio-decode

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

audio-decode

Decode audio data in node or browser

2.2.3
latest
Source
npmnpm
Version published
Weekly downloads
121K
-9.71%
Maintainers
3
Weekly downloads
 
Created
Source

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

  • wasm-audio-decoders – best in class compact & fast WASM audio decoders.
  • Web Audio Decoders – native decoders API, hope one day will be fixed or alternatively polyfilled.
  • decodeAudioData – default in-browser decoding method.
  • ffmpeg.wasm – ultimate encoding/decoding library (8.5Mb of code).

License

MIT  •  🕉

Keywords

audiojs

FAQs

Package last updated on 21 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.