audio
Decode, analyze, edit, play, process, master, restore, deslop and more.
Wav, ogg, flac, mp3 and 20 more.
Streaming, playback during decode.
Loudness, spectrum, pitch, beats, key.
Trim, fade, cut, paste, remove pauses.
Non-destructive, infinite undo.
Speaker and microphone in Node.
Plays while it decodes.
Filters, EQ, dynamics, reverb, pitch.
150+ plugins.
Tone, mid, side, width, loudness.
Matched to a reference.
Clipping, clicks, hum, noise, the room.
Repairs only what it finds.
Clipping, hiss, a band’s excess.
For generated tracks. Not yet judged by ear.
import audio from 'audio'
await audio('/samples/sacred/song-celestial-12.mp3')
.trim()
.normalize('podcast')
.save('episode.mp3')
Usage
Install
import audio from 'audio'
await audio('voice.wav').trim().normalize('podcast').save('clean.mp3')
How it works
A sound is a chain of edits. Nothing is rendered until it is played, saved or measured. On top of its packages it adds paging (no 2 GB limit), streaming (it plays and encodes while it decodes) and non-destructive edits (infinite undo).
Examples
Clean a take, and prove it meets Apple's podcast spec.
let voice = audio('voice.wav') .trim().normalize('podcast') await voice.save('clean.mp3') let { pass, rules } = await voice.check('podcast')Master a song to a reference track: its tone, width and loudness.
audio('mix.wav') .master(await audio('ref.wav')) .save('master.wav')Tighten the pauses of a talking-head video; the same cuts go to the video editor.
let talk = audio('talk.mp4') .shrink(0.3) await talk.save('talk.m4a') await talk.save('talk.edl')The page's Audio element in Node, Bun and Deno: one import, the same events and promises.
import 'audio/polyfill' let song = new Audio('song.mp3') await song.play() song.currentTime = 30
Run
npx audio voice.wav trim normalize podcast save clean.mp3
How it works
A source, its edits in order, a sink. With no sink, a file opens in the terminal's player.
Examples
Check a file against a delivery spec. A fail exits 1, so the line guards a build.
$ audio clean.mp3 check podcast ✓ Loudness -16.44 LUFS -17 to -15 ✓ True peak -1.18 dBTP ≤ -1 passPlay a hook on a loop; play with effects applied live.
$ audio song.mp3 30s..45s play loop $ audio song.mp3 normalize \ broadcast highpass 80hz playSplit an album at its cue sheet, each track tagged.
$ audio album.wav split \ --cue album.cue \ save '{i} - {title}.mp3'
Use
import audio from 'audio'
await audio('take.wav').compressor(-30, 8).save('out.wav')
How it works
A plugin is a processor from an @audio package: an effect, a repair, a synth. Its family installs with audio and loads at the first render that calls it. A value takes its parameter’s unit. The same processor runs in an AudioWorklet and, experimental and on macOS, builds to VST3 and CLAP.
Examples
By its name, a value in its parameter’s unit.
audio('take.wav') .compressor({ attack: '10ms' }) .delay({ time: '250ms' })One of your own: a block processor, by a name of yours.
audio.op('invert', (inp, out) => { for (let c = 0; c < inp.length; c++) out[c].set(inp[c].map(v => -v)) }) audio('take.wav').invert()The contract: a function that returns a function, its parameters on it.
export const gain = (ctx) => (inputs, outputs, params) => { … } gain.params = { gain: { type: 'number', min: -60, max: 24, default: 0, unit: 'dB' }, }
Use
<script type="module"
src="/p/aHR0cHM6Ly9hdWRpby5qcy5vcmcvYXVkaW8vZWxlbWVudHMvaW5kZXguanM"></script>
How it works
The editor in parts: custom elements a page composes, each the HTML face of a module the editor itself runs on, in the page's own DOM and styled by it. A sound's script runs in a worker; the page's thread stays free.
Examples
A sound as a script makes it, with its picture and its parts
<audio-clip> <audio src="/p/aHR0cHM6Ly9hdWRpby5qcy5vcmcvdGFrZS5tcDM" data-name="take.mp3"></audio> <audio-code> <pre><code>audio('take.mp3') .trim() .save('clean.mp3')</code></pre> </audio-code> <audio-wave></audio-wave> <audio-play></audio-play> <audio-save></audio-save> </audio-clip>A script alone, coloured as the editor colours it, editable
<audio-code> <pre><code>audio('take.mp3') .normalize('podcast')</code></pre> </audio-code>The editor whole, in any page: the element's text is its script
<script type="module" src="/p/aHR0cHM6Ly9hdWRpby5qcy5vcmcvZW1iZWQuanM"> </script> <audio-repl height="320"> <pre>audio('chime.wav').trim()</pre> </audio-repl>
Connect
npx add-mcp "npx -y audio --mcp"
What it does
An agent measures, edits and plays sound with the same calls a script makes: Claude Code, Codex, Cursor, Gemini CLI, Zed and others.
Examples
Ask for the result, not the steps.
> make ~/Desktop/interview.m4a podcast-ready and tell me the loudness before and afterThe same as an agent skill.
$ npx skills add audiojs/audioYour own agent inside the editor: it measures, looks at, edits and plays the sound that is open there.
$ npx audio --bridge audio bridge on http://127.0.0.1:7777
What the library does
Open in editorPrepare a podcast take
Trim the silence from both ends and bring the voice to Apple Podcasts' loudness: −16 LUFS, peaks under −1 dBTP. Then check it against the spec, rule by rule.
Like FFmpeg loudnorm
The Song Celestial, chapter 12, read by Jothi Tharavant, LibriVox. Public domain, an excerpt
import audio from 'audio'
await audio('/samples/sacred/song-celestial-12.mp3')
.trim()
.normalize('podcast')
.save('episode.mp3')$ npx audio song-celestial-12.mp3 trim normalize podcast save episode.mp3
Saved episode.mp3 in 0.1s
$ npx audio episode.mp3 check podcast
Apple Podcasts https://podcasters.apple.com/support/893-audio-requirements
✓ Loudness -16.45 LUFS -17 to -15 recommended
✓ True peak -1.42 dBTP ≤ -1 recommended
pass
$ npx add-mcp "npx -y audio --mcp"
> Make ~/Desktop/interview.m4a podcast-ready
and tell me the loudness before and after
Repair a recording
One call measures the take and repairs only what it finds: clipping, clicks, hum, noise, the room, harsh s. Then it sets the loudness.
Like iZotope RX Repair Assistant, Dolby.io Media Enhance. Measured against RX 12
Florence Nightingale on a wax cylinder, 1890. Wellcome Library, CC BY-SA 3.0, an excerpt
import audio from 'audio'
await audio('/samples/historic/florence-nightingale.mp3')
.enhance()
.save('clean.wav')$ npx audio florence-nightingale.mp3 enhance save clean.wav
Saved clean.wav in 2.8s
$ npx audio clean.wav compare florence-nightingale.mp3
against florence-nightingale.mp3: gain 0.73 dB, difference -1.56 dB
· lag 0.4 ms (18.68 samples), read from 0.00 s to 20.00 s
· loudness -19.39 → -16.23 LUFS
· loudness range 13.02 → 9.22 LU
· noise floor -40.18 → -73.03 dB
· 2 kHz octave -26.26 → -26.38 dB, -5.20 dB against the octaves' median change (5.08 dB)
· difference -1.56 dB at the lag and gain
· voice band of 519 voiced frames: median change 4.17 dB, 10th -2.67, 90th 7.58; 1.5 % 10 dB or more under the median
$ npx add-mcp "npx -y audio --mcp"
> Repair florence-nightingale.mp3 and tell me what you changed
Master to a reference
Give it a track that sounds the way you want. The mix takes its tone, in mid and side, its width and its loudness, peaks under −1 dBTP.
Like Matchering
Melodic Adventure Theme, C64 Style, skrjablin, to 8-Bit Battle Loop, Wolfgang_. Both CC0, excerpts
import audio from 'audio'
await audio('/samples/music/8-bit/c64-adventure-theme.mp3')
.master(await audio('/samples/music/8-bit/battle-loop.mp3'))
.save('master.wav')$ npx audio c64-adventure-theme.mp3 master battle-loop.mp3 save master.wav
Saved master.wav in 0.7s
$ npx add-mcp "npx -y audio --mcp"
> Master c64-adventure-theme.mp3 to sound like battle-loop.mp3
Slow down, change key
To learn a piece, or to sing it in your own key: a quarter longer at the same pitch, three semitones lower at the same length.
Like Transcribe!, Moises
Bach, Prelude in C major, Kimiko Ishizaka, The Open Well-Tempered Clavier. Public domain, an excerpt
import audio from 'audio'
await audio('/samples/music/classical/prelude-in-c.mp3')
.stretch(1.25)
.pitch(-3)
.save('practice.mp3')$ npx audio prelude-in-c.mp3 stretch 1.25 pitch -3 save practice.mp3
Saved practice.mp3 in 0.5s
$ npx add-mcp "npx -y audio --mcp"
> Slow prelude-in-c.mp3 down by a quarter
and move it three semitones lower
Remaster a generated track
Measures a generated track and treats only what it finds: clipping, hiss in its top, a band's excess. Then streaming loudness.
Like Tembrica, Brizm, Sunofix. A first hand, not yet judged by ear
Two Planets, generated with Suno, 2024. Wikimedia Commons, public domain, an excerpt
import audio from 'audio'
await audio('/samples/music/generated/two-planets.mp3')
.deslop()
.save('remaster.wav')$ npx audio two-planets.mp3 deslop save remaster.wav
Saved remaster.wav in 0.4s
$ npx audio remaster.wav compare two-planets.mp3
against two-planets.mp3: gain 2.47 dB, difference -30.03 dB
· lag 0, read from 0.00 s to 15.96 s
· loudness -16.44 → -14.00 LUFS
· true peak -5.90 → -3.52 dBTP
· 8 kHz octave -41.39 → -42.68 dB, -3.78 dB against the octaves' median change (2.49 dB)
· 16 kHz octave -53.84 → -54.58 dB, -3.23 dB against the octaves' median change (2.49 dB)
· difference -30.03 dB at the lag and gain
· voice band of 253 voiced frames: median change 2.49 dB, 10th 2.48, 90th 2.49
$ npx add-mcp "npx -y audio --mcp"
> Remaster two-planets.mp3, a Suno track,
and tell me what you changed and why
Editor
Playground repl app for editing audio in browser or desktop
Open the editor// "Goldberg Variations, Aria" by Kimiko Ishizaka, CC0, an excerpt
audio('/samples/music/classical/goldberg-aria.mp3')
.trim(-40)
.normalize(-14)
.fade(.5, 2)
Packages359 in all
All packagesNo package by that name or for that. Try fewer words.
codecs49 packages
- decode
Decode audio data
decode: 24 packages
4.4.0, 24 packages
Decode audio data in node or browser
npm i @audio/decodeimport decode from '@audio/decode'; const { channelData, sampleRate } = await decode(anyAudioBuffer); - encode
Encode audio data
1.12.0, 15 packages
Encode audio data in node or browser
npm i @audio/encodeimport encode from '@audio/encode'; const buf = await encode.wav(channelData, { sampleRate: 44100 }); - midi
MIDI, notation, subtitles
1.0.4, 5 packages
MIDI, notation, subtitles
npm i @audio/midiimport { parse, write, render, musicxml, subtitle } from '@audio/midi' let smf = write(notes, { bpm: 120 }) // notes → SMF bytes let { notes, tempos, duration } = parse(smf) // SMF bytes → notes let { channelData, sampleRate } = render(smf) // SMF bytes → PCM, GM synth map …
- audio-type
Detect a buffer's audio type
2.8.0
Detect a buffer's audio type
npm i audio-typeimport readChunk from 'read-chunk'; // npm install read-chunk import audioType from 'audio-type'; var buffer = readChunk.sync('meow.wav', 0, 64); - pcm-convert
Convert PCM between formats
3.3.0
Convert PCM between formats
npm i pcm-convertimport convert, { parse, detect, stringify, sampleRate } from 'pcm-convert' // dtype conversion convert(new Float32Array([1, -1, 0.5]), 'int16')
analysis80 packages
- loudness
Loudness metering
1.3.0, 7 packages
Loudness metering: BS.1770-4 LUFS, true peak, LRA, ReplayGain, DR, speech contrast, sound labeling
npm i @audio/loudnessimport { lufs, truepeak, lra, replaygain, dr, speechContrast, sounds } from '@audio/loudness' lufs(channels, { fs: 48000 }) // integrated LUFS replaygain(channels, { fs: 48000 }) // { gain, lufs, peak } - measure
Acoustic & system measurement
1.1.5, 7 packages
Acoustic & system measurement: IR capture, response, latency
npm i @audio/measureimport { ir, latency, align, response, lossy, correct, snr, lsd } from '@audio/measure' import chirp from '@audio/synth-chirp' let sweep = chirp({ f0: 20, f1: 20000, duration: 1.5, fs }) let h = ir(recorded, { sweep, f0: 20, f1: 20000, fs, length: 1000 }) // impulse response … - spectral
Spectral features
spectral: 17 packages
1.3.1, 17 packages
Spectral features: centroid, spread, flatness, rolloff, flux, slope, crest, zcr
npm i @audio/spectral - pitch
Pitch detection
2.3.0, 8 packages
Pitch detection: YIN, pYIN, McLeod, HPS, cepstrum, SWIPE, autocorrelation, AMDF
npm i @audio/pitchimport { yin, mcleod } from '@audio/pitch' let fs = 44100 let frame = new Float32Array(2048) // fill from your audio source
- beat
Beat detection
beat: 5 packages
3.1.0, 5 packages
Beat detection: onset detection, tempo estimation, beat tracking
npm i @audio/beatimport { detect, onsets, tempo, beatTrack } from '@audio/beat' // full pipeline: onsets → tempo → beat grid let result = detect(samples, { fs: 44100 }) result.bpm // 120.2 … - mir
Music information retrieval
mir: 16 packages
1.2.0, 16 packages
Music information retrieval: chroma, chord, key; MIREX-parity roadmap
npm i @audio/mirimport { chroma, chord, key } from '@audio/mir' let c = chroma(samples, { fs: 44100 }) // Float32Array[12] let ch = chord(c) // 'C', 'Am', … let k = key(c) // { key: 'C major', scores: [...] } - auditory
Auditory filterbanks
1.0.2, 5 packages
Auditory filterbanks: bark, ERB, mel, gammatone, octave
npm i @audio/auditory - weighting
Frequency weighting filters
1.4.0, 7 packages
Frequency weighting filters: A, B, C, D, K/BS.1770, ITU-R 468, RIAA
npm i @audio/weighting
effects103 packages
- filter
Biquad, comb, ladder filters
filter: 16 packages
3.6.0, 16 packages
Biquad, comb, ladder filters
npm i @audio/filterimport { moogLadder } from '@audio/filter' let params = { fc: 1000, resonance: 0.5, fs: 44100 } for (let buf of stream) moogLadder(buf, params) - eq
Shelf, parametric, graphic EQ
1.3.0, 10 packages
Shelf, parametric, graphic EQ
npm i @audio/eqimport { parametricEq } from '@audio/eq' const fs = 48000 const input = new Float32Array(512) input[0] = 1 // impulse; replace with your mono PCM samples … - dynamics
Compressor, limiter, gate
dynamics: 17 packages
0.6.1, 17 packages
Compressor, limiter, gate
npm i @audio/dynamicsimport { compressor, limiter } from '@audio/dynamics' const sampleRate = 48000 const samples = Float32Array.from({ length: 4800 }, (_, i) => 0.8 * Math.sin(2 * Math.PI * 220 * i / sampleRate)) … - effect
Modulation, delay, distortion
effect: 26 packages
2.4.0, 26 packages
Modulation, delay, distortion
npm i @audio/effectimport { delay } from '@audio/effect' const fs = 48000 const input = new Float32Array(14401) input[0] = 1 // impulse; replace with mono PCM samples …
- saturate
Tape, tube, transistor saturation
saturate: 5 packages
1.3.0, 5 packages
Tape, tube, transistor saturation
npm i @audio/saturate - amp
Guitar/bass amp and cabinet
1.3.0, 2 packages
Guitar/bass amp and cabinet
npm i @audio/amp - reverb
Plate, spring, convolution reverb
1.3.0, 7 packages
Plate, spring, convolution reverb
npm i @audio/reverb - spatial
Panner, widener, crossfeed
spatial: 12 packages
1.3.0, 12 packages
Panner, widener, crossfeed
npm i @audio/spatial
repair28 packages
- denoise
Noise reduction and restoration
denoise: 21 packages
0.12.2, 21 packages
Noise reduction and restoration: gate, spectral subtraction, Wiener, OM-LSA, dehum, declick, decrackle, declip, dewind, deplosive, deesser, debreath, dereverb, debleed, dewow, desqueak
npm i @audio/denoiseimport { denoise, dehum, wiener, declick } from '@audio/denoise' let cleaned = denoise(samples) // auto-classify + dispatch let unhummed = dehum(samples, { freq: 60 }) // explicit method let { out, plan } = denoise(samples, { returnPlan: true }) // see what was chosen - defeedback
Adaptive feedback suppression
1.4.0, 3 packages
Adaptive feedback suppression: analyzer, tracker, notch bank
npm i @audio/defeedback
- vocals
Center vocal isolation & removal
1.0.5
Center vocal isolation & removal
npm i @audio/vocalsimport { isolate, remove } from '@audio/vocals' isolate([L, R]) // keep center-panned content (typically the vocal), discard sides remove([L, R]) // keep sides, discard center — karaoke - chain
Analysis-driven audio chain
0.7.1
Analysis-driven audio chain
npm i @audio/chainimport chain from '@audio/chain' const { channels, recipe, analysis } = chain([left, right], { type: 'speech' }) for (const s of recipe.stages) console.log(`${s.name.padEnd(9)} ${s.why}`) // a voice clipped, in a room, under white noise 16 dB down (bench/rx/assistant.mjs in audio, a tuning take): …
time & pitch36 packages
- stretch
Time stretching
2.5.2, 10 packages
Time stretching: WSOLA, phase vocoder variants, PaulStretch, PSOLA, SMS
npm i @audio/stretchimport { transient, wsola } from '@audio/stretch' let slower = transient(samples, { factor: 2 }) // 2× slower, same pitch let fast = wsola(samples, { factor: 0.75 }) // 1.33× faster - shift
Pitch shifting
shift: 15 packages
1.3.0, 15 packages
Canonical pitch-shifting algorithms: phase vocoder, peak-locked, transient-aware, PSOLA, WSOLA, granular, PaulStretch, SMS, HPSS, formant, sampler, hybrid
npm i @audio/shiftimport { transient } from '@audio/shift' // Batch let pitched = transient(audio, { semitones: 5 }) - tune
Pitch correction
0.6.1, 3 packages
Pitch correction: scale snap, MIDI-target, drawn curve
npm i @audio/tuneimport { snap, tuneMidi } from '@audio/tune' snap(data, { scale: 'major', root: 0 }) // to C major, vibrato kept snap(data, { speed: 0 }) // the hard-tuned effect tuneMidi(data, { guide: parsedSmf.notes }) // retune to a reference melody …
- scrub
Sound under a dragged caret
1.0.0
Sound under a dragged caret
npm i @audio/scrubimport scrub from '@audio/scrub' let voice = scrub([left, right], 44100, caret) // vocoder + noise; or { method: 'tape' }, … let out = [new Float32Array(128), new Float32Array(128)] voice.render(out, caret) // the next block; move the caret between blocks - sinusoidal
Sinusoidal modeling
1.0.2, 3 packages
Sinusoidal modeling: partial tracking, additive resynthesis, residual
npm i @audio/sinusoidal
synthesis25 packages
- synth
Synthesis & signal generators
synth: 20 packages
1.7.0, 20 packages
Synthesis & signal generators: noise colors, oscillator, chirp, DTMF, pluck, risset drum, rhythm track, envelope, LFO
npm i @audio/synth
- voice
Voice synthesis
1.0.3, 3 packages
Voice synthesis: vocal tract, voder, glottal source
npm i @audio/voiceimport { glottis, tract, voder, VOWELS, BANDS } from '@audio/voice' let excitation = glottis({ f0: 120, duration: 0.5 }) // → Float32Array (generator) let vowel = tract(excitation, { shape: 'a' }) // Float32Array → Float32Array (filter)
neural10 packages
render5 packages
- wavearea
Edit audio in textarea
1.1.0
Edit audio in textarea
npm i wavearea - gl-waveform
WebGL2 renderer for time series
5.3.0
WebGL2 renderer for time series
npm i gl-waveformimport Waveform from 'gl-waveform' // the drawing buffer is yours to size canvas.width = canvas.clientWidth * devicePixelRatio canvas.height = canvas.clientHeight * devicePixelRatio - gl-spectrogram
WebGL2 spectrogram renderer
2.4.0
WebGL2 spectrogram renderer: FFT on the GPU, reassigned to one-pixel lines, sharp at every zoom
npm i gl-spectrogramimport Spectrogram from 'gl-spectrogram' // the drawing buffer is yours to size canvas.width = canvas.clientWidth * devicePixelRatio canvas.height = canvas.clientHeight * devicePixelRatio
- wavefont
Typeface for visualizing waveform
3.8.2
Typeface for visualizing waveform
npm i wavefontimport wf, { char, shift } from 'wavefont' // characters for values from 0..127 range (clamped & rounded) wf(0, 1, 50, 99, 127) // 'ĀāIJţſ' - linefont
Typeface for visualizing line chart
3.4.2
Typeface for visualizing line chart
npm i linefontimport lf, { char } from 'linefont' // characters for values from 0..127 range (clamped & rounded) lf(0, 1, 50, 99, 127) // 'ĀāIJţſ'
platform5 packages
- web-audio-api
Web Audio API outside browsers
1.6.0
Web Audio API outside browsers
npm i web-audio-apiimport { OfflineAudioContext } from 'web-audio-api' const ctx = new OfflineAudioContext(2, 44100, 44100) // 1 second, stereo const osc = ctx.createOscillator() osc.frequency.value = 440 … - audio-buffer
AudioBuffer ponyfill and utils
7.3.2
AudioBuffer ponyfill and utils
npm i audio-bufferimport AudioBuffer from 'audio-buffer' import { from, trim, normalize } from 'audio-buffer/util' let buf = from([0, 0, 0.5, 0.8, 0.3, 0, 0]) buf = normalize(trim(buf))
- mic
Capture audio from microphone
2.0.0
Capture audio from microphone in browser/node
npm i @audio/micimport mic from '@audio/mic' let read = mic({ sampleRate: 44100, channels: 1, … - speaker
Output audio to speaker
speaker: 1 package
2.5.1, 1 package
Output audio to speaker
npm i @audio/speakerimport speaker from '@audio/speaker' let write = speaker({ sampleRate: 44100, channels: 2, …
build5 packages
- plugin
Processor contract and targets
0.1.5, 2 packages
JavaScript audio processors to AudioWorklet nodes and experimental macOS VST3 plugins
npm i @audio/pluginexport const gain = (ctx) => (inputs, outputs, params) => { const x = inputs[0], y = outputs[0], g = 10 ** (params.gain[0] / 20) for (let c = 0; c < y.length; c++) for (let i = 0; i < y[c].length; i++) y[c][i] = x[c][i] * g } … - assert
Audio assertions for CI
0.2.0
Audio assertions for CI
npm i @audio/assertimport { frequency, silent, unclipped, peak } from '@audio/assert' frequency(buffer, 44100) // → 440.01 (measured Hz) frequency(buffer, 44100, 440) // → 440.01, or throws "frequency 452.31 Hz (47.9 cents from 440 Hz)..." silent(tail) // → 0.0000012, or throws "not silent: peak -52.1 dBFS..." …
- test
Audio tool conformance tests
0.1.0
Audio tool conformance tests
npm i @audio/test
dsp12 packages
- digital-filter
IIR and FIR filter design
2.4.3
IIR and FIR filter design
npm i digital-filterimport { butterworth, filter, onePole } from 'digital-filter' // import butterworth from 'digital-filter/iir/butterworth.js' onePole(data, { fc: 100, fs: 44100 }) // smooth in-place - fourier-transform
Real and complex FFT
2.8.0
Real and complex FFT
npm i fourier-transformimport rfft from 'fourier-transform' // magnitude spectrum (N/2 bins) const spectrum = rfft(waveform) - window-function
Windows for spectral analysis
3.0.3
Windows for spectral analysis
npm i window-functionimport { hann, kaiser, generate, apply } from 'window-function' // Every window: fn(i, N, ...params) → number hann(50, 101) // single sample → 1.0 - periodic-function
Periodic waveform functions
2.1.2
Periodic waveform functions — phase normalized to [0,1]
npm i periodic-functionimport { sine, square, wavetable } from 'periodic-function' sine(0.25) // 1 (peak) square(0.75) // -1 (low) wavetable(null, [0, 1, 0, 0.5]) // Float32Array wavetable from Fourier coefficients - a-weighting
A/B/C/D/Z/M weighting curves
2.0.1
A/B/C/D/Z/M weighting curves
npm i a-weightingimport { a } from 'a-weighting' // apply a-weighting to frequency spectrum let weighted = frequencies.map((magnitude, i, data) => { let frequency = 22050 * i / data.length …
- stft
Batch and streaming STFT
2.1.0
Batch and streaming STFT
npm i @audio/stftimport { stftBatch, stftStream, stftAnalyse } from '@audio/stft' // process(mag, phase, state, ctx) → { mag, phase }, called per frame const identity = (mag, phase) => ({ mag, phase }) - window
STFT windows and COLA check
1.0.4
STFT windows and COLA check
npm i @audio/windowimport window, { apply, cola, hann } from '@audio/window' let w = window('hann', 1024) // periodic (DFT-even) — for STFT let sym = window('hann', 1024, { periodic: false }) // symmetric — for filter design - resample
Sample-rate conversion
1.2.5, 3 packages
Sample-rate conversion: sinc, linear, polyphase
npm i @audio/resampleimport { sinc, linear, polyphase, polyphaseStream } from '@audio/resample' sinc(data, { from: 44100, to: 48000 }) // → Float32Array linear(data, { from: 44100, to: 48000 }) // → Float32Array polyphase(data, { from: 44100, to: 48000 }) // → Float32Array - note
Hz, MIDI, note names
1.1.0
Hz, MIDI, note names
npm i @audio/noteimport { hzToMidi, midiToHz, name, parse, cents, SCALES, snapMidi, snapHz } from '@audio/note' name(69) // 'A4' cents(443) // { midi: 69, name: 'A4', hz: 440, cents: 11.7 } — tuner readout snapHz(450, { scale: 'major' }) // nearest major-scale frequency
Plugins
Processors that plug into audio by name. Each on its own from npm, in the editor, as a VST next.
All pluginsEQ
Equalization and tone shaping: shelves, parametric, graphic, baxandall, tilt, crossover.
824 a monthnpmeditorVST next
Dynamics
Compressor, limiter, gate, expander, de-esser, ducker, softclip, compand, transient shaper.
494 a monthnpmeditorVST next
Reverb
Schroeder, Freeverb, Dattorro plate, FDN, convolution, spring, shimmer.
437 a monthnpmeditorVST next
Denoise
Noise reduction and restoration: gate, spectral subtraction, Wiener, dehum, declick, dereverb.
938 a monthnpmeditorVST next
Stretch
Time stretching: WSOLA, phase vocoder variants, PaulStretch, PSOLA, SMS.
1,354 a monthnpmeditorVST next
Tools24 tools
Audio utilities that run in your browser, nothing uploaded. Built with audio packages.
All 24 toolsConvert5 tools
mp3 to wav, flac to mp3, m4a to mp3, mp4 to mp3, midi to mp3
Analyze9 tools
lufs meter, bpm finder, key finder, guitar tuner, audio to text
Applications
Larger things built on the stack. More are coming.
In the tools
Prosody editor
Shape how a sentence sounds. Adjust its pitch, emphasis and pace.
Coming
mel
Music expression language. Draw, reshape, and save sounds as editable curves.
Coming
Oscillators
A visualizer of oscillators: each wave seen as it sounds.
Coming
Piano
A keyboard to play.
About
Open audio layer for JavaScript. Fast, portable, modular DSP.
Roadmap, comparisonPerformance first
Plays while it decodes. Every figure is timed against FFmpeg and SoX, in the open.
Modular
300+ packages, one job each, composable: use one alone, or all of them through audio.
Tested & verified
web-audio-api passes 100% of its W3C tests; audio is checked against 14 other tools, feature by feature.
Open & trusted
MIT licensed. Source, tests and timings are public; 1,575,067 npm downloads of audio-type, 24 Oct – 22 Nov 2026.
No Web Audio, no FFmpeg
Codecs and processing are its own, in JavaScript and WebAssembly. None of it needs Web Audio, none of it FFmpeg.
Utils24 utils
Audio utilities that run in your browser, nothing uploaded. Built with audio packages.
All utilsArticles10 articles
Words under a waveform
10 min
Speech clusters from pauses, spaces bent by least squares, lines broken in pauses, one selection for words and bars
Drawing a waveform
6 min
Every Nth sample, lowest and highest, RMS, brightness by level, true peaks, decibels, colour, stereo
Seeing sound
3 min
Frames, windows, frequency axes, colour maps, reassignment, many resolutions, multitapers, Wigner–Ville
Hearing a moment
5 min
Tape, loops, grains, noiscillators, random phase, phase vocoders: what a held caret plays, and what it costs
Where the panels go
6 min
Splits, docks, activity bars, inspectors, tabs, floating windows, modules: seven layouts of one audio editor, and the one to keep
Audio in JavaScript
6 min
new Audio(), a Web Audio equalizer, decoding and writing files, Node.js, a library, and which tool fits which job
Recording audio in the browser
9 min
getUserMedia and its processing, MediaRecorder's formats in your browser, every sample to a WAV, latency, takes that survive a crash
Hearing what isn't there
8 min
Shepard tones, the Risset rhythm, Deutsch's scale illusion, binaural beats, the missing fundamental: each built live, with the switch that breaks it
Naming a sound
10 min
Silence by level, speech or music by inaSpeechSegmenter, anything else by YAMNet's 521 classes and a bar: what a page can say a sound is, what it costs, and where it is wrong
What a generated track carries
7 min
Sixteen songs from Suno, Udio and their kind beside twenty-three by people: where they differ, where they do not, what the cleaners do, and a remaster planned from the measurements
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?
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 file | audio | FFmpeg | SoX |
|---|---|---|---|
| WAV decode | 246 ms | 73 ms | 50 ms |
| MP3 decode | 306 ms | 484 ms | – |
| LUFS | 229 ms | 336 ms | – |
| Peak normalize | 405 ms | – | 555 ms |
| Resample to 48 kHz | 450 ms | 292 ms | 1.04 s |
| Time stretch 0.8× | 3.09 s | 665 ms | 5.82 s |
| Pitch shift +2 st | 2.83 s | 821 ms | 6.02 s |
How it was measured, 2026-11. Shorter is faster.
How does it compare to Essentia, librosa or Tone.js?
| audio | edit, analyze, play, record |
|---|---|
| pydub | high-level edit: slice, fade, normalize |
| librosa | music analysis |
| aubio | pitch, onset, beat, MFCC |
| Essentia | music analysis, 240+ algorithms |
| Pedalboard | effects, VST hosting |
| Tone.js, Howler | play in a page |
| SoX | command-line batch DSP |
| FFmpeg | command-line multimedia |
| Audacity | desktop editor |
See comparison
How big is it?
| In a page | 155.5 KB gzipped; codecs load on first use |
|---|---|
| One package | @audio/decode-wav: 24 KB |
| All of it | npm i audio: 16.6 MB, the 24 decoders and 14 encoders in it, nothing compiled |
| For scale | FFmpeg 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?
| MIT | audio and most packages |
|---|---|
| GPL-2.0 | the AAC, AC-3 and DTS decoders |
| LGPL | a 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.
Pro
ComingExtra advanced features and better performance.
from$10you name the price
Pay what you want · the floor keeps bots out
In Pro
- Native speed (WASM)
- VST plugins
- Neural features
- Advanced presets
- AI and MCP
Free, as it is
- The library, the CLI, the editor, the MCP server
- Every package, under MIT
- The tools in the browser
Until Pro ships, maintenance is funded by sponsorship.
Become a sponsorRoadmap
Shipped
Modules
The core units, one job each: codecs, filters, analysis, synthesis. Web Audio outside the browser.
Shipped
Tools
A CLI, an editor, an MCP server, and 24 tools in the browser.
Now
Apps
Audio for Mac. A demo on every module's page. A VS Code plugin.
Next
Plugins
Processors to try in the browser and download. A VST creator: JavaScript compiled to plugins, into the DAWs. Native speed with JZ.
Later
On top
audio-lab, nodes to connect. pitch, a prosody editor. An enhancer. mel, a music language.
Contribute
The source is on GitHub, under audiojs: report what breaks, send a fix, add a codec or an edit.
github.com/audiojs
Sponsor
Maintenance is funded by sponsorship: compatibility fixes, issue triage, releases, tests and documentation (funding details).
github.com/sponsors/audiojs
In the wild
Built on audiojs by others. Each is credited to its maker, and comes off this list at its maker's request.
audio/ui
Cécé Lucien Loua, Ouest Labs
Audio UI components for the web: knobs, faders, meters, waveforms, timelines, piano rolls. Its engine runs @audio dynamics, filters, reverbs and effects in an AudioWorklet.
Comparison
What audio aims for: the common case these tools serve, one file, some transforms, one output, anywhere JavaScript runs.
| Tool, made for | It has, audio has not | audio has, it has not |
|---|---|---|
| pydubhigh-level edit (slice/fade/normalize)Python, MIT | A Python object for a sound ( audionot a Python library Works withFFmpeg | 63 of 93 I/O 2Editing 4Time / pitch 3Volume / dynamics 6Filters 7Spatial effects 9Restoration 4Analysis (volume) 4Analysis (spectral) 7Analysis (rhythm/melody) 8Playback / record 4Synthesis 4Plugin hosting 1 |
Dynamic time warping, to align one sequence to another ( audionone FasterWAV decode 2.9×, MP3 decode 1.1×, FFT spectrum (1024-pt) 1.5×, MFCC (13 coeff) 1.2× of 8 timed Works withscikit-learn, torchaudio, numpy | 52 of 93 I/O 1Editing 8Time / pitch 1Volume / dynamics 8Filters 5Spatial effects 9Restoration 5Analysis (volume) 3Playback / record 6Synthesis 5Plugin hosting 1 | |
| aubiopitch + onset + beat + MFCCC (Python/JS bindings), GPL-3 | A C library to link into a native program, written for real time "with as low delay as possible"; its arrays are NumPy arrays in Python aubio.org audioJavaScript and WebAssembly only Works withPureData, MaxMSP, Python, JS | 65 of 93 Editing 12Time / pitch 5Volume / dynamics 10Filters 4Spatial effects 9Restoration 5Analysis (volume) 4Analysis (spectral) 2Analysis (rhythm/melody) 4Playback / record 4Synthesis 5Plugin hosting 1 |
| essentiaMIR / 240+ algorithmsC++ (Python/JS bindings), AGPL-3 (commercial avail.) | Pre-trained models for music: genre by Discogs' styles (400 and 519 classes), danceability, embeddings essentia.upf.edu audiosound classes by YAMNet ( Works withTensorFlow, Gaia, essentia.js | 46 of 93 Editing 10Time / pitch 4Volume / dynamics 6Filters 2Spatial effects 9Restoration 4Analysis (volume) 1Playback / record 4Synthesis 5Plugin hosting 1 |
Python with the interpreter's lock released: effects on several cores from one process, and in audionot a Python library FasterWAV decode 7.2× of 4 timed Works withTensorFlow, PyTorch, JUCE plugins | 67 of 93 Editing 12Time / pitch 2Volume / dynamics 5Filters 6Spatial effects 5Restoration 4Analysis (volume) 7Analysis (spectral) 7Analysis (rhythm/melody) 8Playback / record 6Synthesis 5 | |
Reads and writes Sun AU, Sound Blaster VOC, NIST SPHERE, Amiga 8SVX, Macintosh HCOM, HTK and Dialogic/OKI VOX files linux.die.net audiono codec for these FasterWAV decode 4.9× of 5 timed Works withshell, FFmpeg | 43 of 93 I/O 2Editing 6Time / pitch 1Volume / dynamics 2Filters 3Spatial effects 1Restoration 2Analysis (volume) 2Analysis (spectral) 6Analysis (rhythm/melody) 8Playback / record 4Synthesis 4Plugin hosting 2 | |
Video: decoding, encoding, filtering and muxing the pictures with the sound ffmpeg.org audioreads the sound out of a video file and leaves the pictures Network protocols, read and written: RTMP, RTSP, RTP, SRT, Icecast and others ffmpeg.org audionone Hardware-accelerated decoding ( audionone Binaural rendering through measured HRTFs in SOFA files ( audioa spherical-head panner, azimuth only, no measured HRTFs ( FasterWAV decode 3.4×, Resample 44.1k→48k 1.5×, Time stretch 0.8× 4.6×, Pitch shift +2 st 3.4× of 6 timed Works withLADSPA/LV2, ffmpeg.wasm | 30 of 93 I/O 2Editing 5Filters 1Analysis (volume) 1Analysis (spectral) 5Analysis (rhythm/melody) 8Playback / record 4Synthesis 4 | |
Nyquist, a Lisp-based language for sound synthesis and analysis, to write effects in manual.audacityteam.org audioeffects written in JavaScript ( A desktop application, with installers for Windows, macOS and Linux audacityteam.org audioan editor in the browser; a Mac app, not released Works withVST/AU/LV2 plugins | 19 of 93 I/O 2Time / pitch 1Filters 3Spatial effects 2Restoration 1Analysis (spectral) 5Analysis (rhythm/melody) 3Synthesis 2 | |
| MATLAB Audio Toolboxscientific DSP + ML for audioMATLAB, proprietary | Psychoacoustic metrics: perceived loudness (ISO 532-1/2), sharpness, roughness and fluctuation strength mathworks.com audioloudness by ITU-R BS.1770 and EBU R 128 ( Works withSimulink, Deep Learning Toolbox | 24 of 93 Editing 5Volume / dynamics 3Filters 1Spatial effects 4Restoration 3Analysis (volume) 2Analysis (spectral) 2Analysis (rhythm/melody) 3Synthesis 1 |
Read off docs/comparison.md: what each tool gives, 13 facts from the tools' own documentation, each with its source and what audio has in its place, not all there is; then its matrix of 93 features, its timings of 2026-11 and what it says each tool works with. The matrix lists what audio does, so the right column counts audio's own list.
npm i audiobrew install ffmpegbrew install soxpip install librosapip install pedalboardstandalone installer–––––––Features75 / 7958 / 7951 / 7914 / 7918 / 7916 / 7930 / 7911 / 792 / 792 / 792 / 792 / 793 / 79
Speedbaseline2.5× faster1.9× slower1.1× slower2× slower––––––––
has, passesfailspartialhas not, no equivalentnot applicable–no data
From docs/comparison.md, timed 2026-11, and the conformance suite, run 2026-10-01; not a certification. Names and marks are their owners'.
By its own documentation
Offers91 / 9329 / 9340 / 9327 / 9346 / 9325 / 9349 / 9362 / 9372 / 9368 / 93
What each tool offers, as docs/comparison.md lists it from the tools' own documentation: 93 features in 13 groups, a mark's tooltip the names it goes by there. Not measured: the chart above is.