audio

Decode, analyze, edit, play, process, master, restore, deslop and more.

import audio from 'audio'

await audio('/samples/sacred/song-celestial-12.mp3')
  .trim()
  .normalize('podcast')
  .save('episode.mp3')

FAQ

How is it different from the Web Audio API?

Audio.js is platform independent stack with own DSP.

See web-audio-api

Do I have to take all of it?

No. Every package works alone: npm i @audio/decode. audio wires them behind one API and loads each on first use.

See packages

Does it need ffmpeg or native addons?

No FFmpeg: codecs and DSP are JavaScript and WebAssembly. In Node, the speaker and the microphone use one small addon, prebuilt for macOS, Linux and Windows. Nothing compiles at install.

What formats does it decode and encode?
Decode, 24WAV, MP3, FLAC, Opus, Vorbis, AAC, MP4, AIFF, CAF, WebM, WavPack, APE, TTA, MPC, AC-3, E-AC-3, DTS, WMA, AMR, GSM, DSD, QOA, AVI, MOD
Encode, 14WAV, MP3, FLAC, Opus, OGG, AAC, MP4, ALAC, AIFF, CAF, WebM, WavPack, GSM, QOA

A package each, loaded on first use.

Is it as fast as FFmpeg or SoX?

Not as fast as FFmpeg yet: FFmpeg wins four of the six timed against it. Ahead of SoX in four of five.

10-minute fileaudioFFmpegSoX
WAV decode246 ms73 ms50 ms
MP3 decode306 ms484 ms–
LUFS229 ms336 ms–
Peak normalize405 ms–555 ms
Resample to 48 kHz450 ms292 ms1.04 s
Time stretch 0.8×3.09 s665 ms5.82 s
Pitch shift +2 st2.83 s821 ms6.02 s

How it was measured, 2026-11. Shorter is faster.

How does it compare to Essentia, librosa or Tone.js?
audioedit, analyze, play, record
pydubhigh-level edit: slice, fade, normalize
librosamusic analysis
aubiopitch, onset, beat, MFCC
Essentiamusic analysis, 240+ algorithms
Pedalboardeffects, VST hosting
Tone.js, Howlerplay in a page
SoXcommand-line batch DSP
FFmpegcommand-line multimedia
Audacitydesktop editor

See comparison

How big is it?
In a page155.5 KB gzipped; codecs load on first use
One package@audio/decode-wav: 24 KB
All of itnpm i audio: 16.6 MB, the 24 decoders and 14 encoders in it, nothing compiled
For scaleFFmpeg in WebAssembly, @ffmpeg/core: 64.7 MB

Sizes unpacked, as npm states them, 26 Nov 2026.

Is my audio uploaded anywhere?

No. The tools and the editor run in your browser. Nothing is uploaded.

What is the licence?
MITaudio and most packages
GPL-2.0the AAC, AC-3 and DTS decoders
LGPLa few others, MP3 among them

A decoder keeps the licence of the code it is built from. Each package’s page states its own.

TypeScript?

Yes. audio ships its types, audio.d.ts.