@audio/loudness-truepeak

中文文档
1.1.7发布于 2026/10/13MITTypeScriptES Module零依赖近 30 天下载 2146

True peak (dBTP) — 4× sinc-oversampled inter-sample peak (BS.1770-5 Annex 2 methodology)

原始使用文档

@audio/loudness-truepeak npm MIT

True peak (dBTP) — 4× sinc-oversampled inter-sample peak (BS.1770-5 Annex 2 methodology)

npm install @audio/loudness-truepeak
import truepeak from '@audio/loudness-truepeak'

True peak per ITU-R BS.1770-5 Annex 2 (oversample, rectify, take the maximum) and its recommends 5 ("or a method that gives similar or superior results"): per channel, the samples and the points between them, 4 a sample by default, read polyphase through a 96-tap Kaiser-windowed sinc (β 8) with silence outside the signal; each local maximum of the points is refined by the parabola through it and its neighbours, which finds the peak between them. The maximum across all channels is reported. Against the waveform read 32× through a Kaiser-windowed sinc (β 14, 128 taps a phase), speech, white noise, noise clipped 18 dB, limited speech and EBU Tech 3341 cases 15-23 read within 0.01 dB at 8 to 48 kHz; the 32-tap Lanczos kernel before it, reading its points alone, read clipped or limited material up to 0.4 dB low.

truepeak(channels)                        // default 4× oversampling @ 48000 Hz
truepeak(channels, { oversample: 8 })     // finer oversampling
ParamDefault
fs48000Sample rate, Hz
oversample4Points a sample (BS.1770-5 Annex 2: 4 at 48 kHz); a fraction rounds up

Accepts Float32Array (mono) or Float32Array[] (multichannel — the maximum peak across all channels is returned). Returns a number (true peak in dBTP), or -Infinity for silence.

Use when: checking a master against a dBTP ceiling (e.g. −1 dBTP delivery specs) before lossy encoding, where inter-sample overs would otherwise clip after decode.

Per ITU-R BS.1770-5 Annex 2; tested against EBU Tech 3341 cases 15-23 and a 32× band-limited reference; libebur128 1.2.6 reads the same noise 0.08-0.84 dB lower.


Part of @audio/loudness — the loudness family umbrella. Documented from the reference implementation.

MIT © audiojs

版本与发布记录

@audio/loudness-truepeak 共发布 9 个版本,首次发布于 2026/07/09;过去 12 个月发布了 9 个版本。

版本发布日期距今
1.1.7latest2026/10/1326 天前
1.1.62026/09/291 个月前
1.1.52026/09/271 个月前
1.1.42026/08/182 个月前
1.1.32026/07/113 个月前
1.1.22026/07/113 个月前

关于 @audio/loudness-truepeak 的常见问题

@audio/loudness-truepeak 是什么?

True peak (dBTP) — 4× sinc-oversampled inter-sample peak (BS.1770-5 Annex 2 methodology)

如何安装 @audio/loudness-truepeak?

在项目目录运行 npm install @audio/loudness-truepeak,或使用 pnpm add / yarn add / bun add。

@audio/loudness-truepeak 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@audio/loudness-truepeak 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@audio/loudness-truepeak 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@audio/loudness-truepeak 可以商用吗?

@audio/loudness-truepeak 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@audio/loudness-truepeak 的下载量有多少?

根据 npm 官方下载统计,@audio/loudness-truepeak 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,146 次,日均约 72 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@audio/loudness-truepeak 还在维护吗?

最新版本 1.1.7 发布于 2026/10/13(26 天前);至今共发布 9 个版本,其中过去 12 个月发布了 9 个;首次发布于 2026/07/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。