Files
skills/docs/media/audio/audio-analysis-loudness
2026-05-29 08:20:56 +01:00
..
2026-05-29 08:20:56 +01:00
2026-05-29 08:20:56 +01:00

@suaveplan/audio-analysis-loudness - Universal ITU-R BS.1770-4 loudness analyser: K-weighting, gated integrated LUFS, momentary and short-term loudness, EBU R128 loudness range, 4x oversampled true-peak detection, RMS, sample peak, and per-channel DC offset. Streaming and block-level metering for broadcast compliance, mastering, and auto-normalisation pipelines.

Universal ITU-R BS.1770-4 loudness analyser. Drop-in AnalysisOp plugin for the @suaveplan/audio-* family.

Documentation tree

  • loudness-range — loudness-range computes the EBU Tech 3342 loudness range (LRA, in LU) — a statistical measure of dynamic spread. It t…
  • lufs — lufs contains the kernel of BS.1770-4 loudness measurement: the per-block mean-square energy calculation, the BS.1770…
  • true-peak — true-peak implements true-peak (dBTP) detection via 4× polyphase oversampling, per ITU-R BS.1770-4 Annex 2. Sample pe…
  • error-codes — This module owns the stable, machine-readable error-code registry for @suaveplan/audio-analysis-loudness. Every fault…
    • error-codes — This module owns the stable, machine-readable error-code registry for @suaveplan/audio-analysis-loudness. Every fault…
  • filters — k-weighting implements the ITU-R BS.1770 K-weighting filter — a two-stage IIR biquad cascade applied per channel befo…
    • k-weighting — k-weighting implements the ITU-R BS.1770 K-weighting filter — a two-stage IIR biquad cascade applied per channel befo…
  • meter — LoudnessMeter is the orchestration layer of @suaveplan/audio-analysis-loudness. It wires the K-weighting filter, th…
    • loudness-meter — LoudnessMeter is the orchestration layer of @suaveplan/audio-analysis-loudness. It wires the K-weighting filter, th…

Features

  • Integrated LUFS via two-gate algorithm (absolute −70, relative −10 LU).
  • Momentary (400 ms) and short-term (3 s) loudness.
  • EBU Tech 3342 loudness range (LRA in LU).
  • 4× oversampled true-peak detection (dBTP, per BS.1770-4 Annex 2).
  • Sample peak (dB), RMS (dB), per-channel DC offset.
  • Streaming analyzeStream whose final yield equals batch analyze.
  • Real-time analyzeBlock for live meters.
  • Finite silence floors — no -Infinity ever leaks to consumers.
  • OTel span audio.analysis.loudness, counter, histograms.
  • Pure universal: no window, no document, no node:fs.

Install

bun add @suaveplan/audio-analysis-loudness

Quick start

import { LoudnessMeter } from "@suaveplan/audio-analysis-loudness";

const meter = new LoudnessMeter();
const result = await meter.analyze(doc);
console.log({
  integrated: result.lufs,
  range: result.loudnessRange,
  truePeak: result.truePeak,
});

License

MIT