@audio/denoise 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/index.js +23 -3
  3. package/package.json +2 -3
package/README.md CHANGED
@@ -68,7 +68,7 @@ denoise(data, { force: 'wiener' }) // skip classifie
68
68
  2. impulses (excess kurtosis of AR residual > 12)
69
69
  3. sibilance (high/mid band power ratio > 8)
70
70
  4. LF rumble (low/mid band power ratio > 3)
71
- 5. non-stationary noise (frame-energy CV > 0.6) → omlsa
71
+ 5. non-stationary noise (CV of the rolling-minimum frame-energy floor > 0.3) → omlsa
72
72
  6. otherwise → wiener
73
73
 
74
74
 
@@ -135,7 +135,7 @@ deplosive(data, { triggerRatio: 4, attack: 0.005, release: 0.08 })
135
135
 
136
136
  ### `deesser`
137
137
 
138
- Dynamic peaking EQ centred on the sibilance band. Detection runs on a HP side-chain; when the envelope exceeds threshold, a negative-gain peaking EQ at `freq` engages on the audio path. Re-computed every `block` samples for smooth gain riding.
138
+ Dynamic peaking EQ centred on the sibilance band. Detection runs on a HP side-chain; when the envelope exceeds threshold, a negative-gain peaking EQ at `freq` engages on the audio path. Re-computed every `block` samples for smooth gain riding. Backed by [`@audio/dynamics-deesser`](https://github.com/audiojs/dynamics) `mode: 'band'` since the 2026-07 near-dupe merge — same seconds-based options here.
139
139
 
140
140
  ```js
141
141
  deesser(data, { freq: 6500, threshold: -28, ratio: 4 })
@@ -292,7 +292,7 @@ dereverb(data, { t60: 0.6, predelay: 0.04 })
292
292
 
293
293
  ### `gate`
294
294
 
295
- Look-ahead noise gate with hysteresis.
295
+ Look-ahead noise gate with hysteresis. Backed by [`@audio/dynamics-gate`](https://github.com/audiojs/dynamics) since the 2026-07 near-dupe merge — same seconds-based options here; `closeThreshold` (default `threshold − 6` dB) sets the hysteresis close level.
296
296
 
297
297
  ```js
298
298
  gate(data, { threshold: -45, attack: 0.005, release: 0.1, hold: 0.05, lookahead: 0.005 })
package/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // @audio/denoise — noise reduction & restoration umbrella re-exporting every @audio/denoise-* atom.
2
2
  // For smaller bundles, depend directly on the individual atom.
3
3
 
4
- export { default as gate } from '@audio/denoise-gate'
4
+ import gate_ from '@audio/dynamics-gate'
5
+
5
6
  export { default as dehum } from '@audio/denoise-dehum'
6
7
  export { default as specsub } from '@audio/denoise-spectral'
7
8
  export { default as wiener } from '@audio/denoise-wiener'
@@ -11,13 +12,32 @@ export { default as decrackle } from '@audio/denoise-decrackle'
11
12
  export { default as declip } from '@audio/denoise-declip'
12
13
  export { default as dewind } from '@audio/denoise-dewind'
13
14
  export { default as deplosive } from '@audio/denoise-deplosive'
14
- export { default as deesser } from '@audio/denoise-deesser'
15
15
  export { default as debreath } from '@audio/denoise-debreath'
16
16
  export { default as dereverb } from '@audio/denoise-dereverb'
17
- export { default as denoise, classify } from '@audio/denoise-detect'
17
+ export { default as denoise, classify, deesser } from '@audio/denoise-detect'
18
18
  export { default as repair } from '@audio/denoise-repair'
19
19
 
20
20
  export { snr, segSnr, lsd, nrr, speechAttenuation } from '@audio/quality'
21
21
  export { vad, spp, ddSnr } from '@audio/vad'
22
22
  export { noiseProfile, minStats, imcra } from '@audio/noise-estimate'
23
23
  export { stftBatch, stftStream, stftAnalyse } from '@audio/stft'
24
+
25
+ // gate — @audio/dynamics-gate behind this family's seconds-based, in-place API
26
+ // (2026-07 near-dupe merge: the hysteresis + look-ahead gate lives in dynamics-gate).
27
+ // Batch shape — for chunked streaming use the dynamics streams. deesser's matching
28
+ // adapter lives in @audio/denoise-detect (re-exported above) — classify() needs it
29
+ // internally, so the umbrella imports rather than duplicates it.
30
+ export const gate = (data, params = {}) => {
31
+ let th = params.threshold ?? -40
32
+ data.set(gate_(data, {
33
+ sampleRate: params.fs || 44100,
34
+ threshold: th,
35
+ closeThreshold: params.closeThreshold ?? th - 6,
36
+ attack: (params.attack ?? 0.001) * 1000,
37
+ release: (params.release ?? 0.05) * 1000,
38
+ hold: (params.hold ?? 0.01) * 1000,
39
+ range: params.range ?? -80,
40
+ lookahead: (params.lookahead ?? 0.005) * 1000,
41
+ }))
42
+ return data
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audio/denoise",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "description": "Noise reduction — gate, spectral subtraction, Wiener, OM-LSA, dehum, declick, decrackle, declip, deesser, dereverb",
6
6
  "sideEffects": false,
@@ -57,11 +57,10 @@
57
57
  "@audio/denoise-declip": "^0.1.0",
58
58
  "@audio/denoise-dewind": "^0.1.0",
59
59
  "@audio/denoise-deplosive": "^0.1.0",
60
- "@audio/denoise-deesser": "^0.1.0",
61
60
  "@audio/denoise-debreath": "^0.1.0",
62
61
  "@audio/denoise-dereverb": "^0.1.0",
63
- "@audio/denoise-gate": "^0.1.0",
64
62
  "@audio/denoise-detect": "^0.1.0",
63
+ "@audio/dynamics-gate": "^0.1.4",
65
64
  "@audio/denoise-repair": "^0.1.0",
66
65
  "@audio/quality": "^1.0.0",
67
66
  "@audio/stft": "^1.0.3"