@audio/denoise-detect 0.1.4 → 0.1.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 +39 -0
  2. package/denoise.js +18 -1
  3. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @audio/denoise-detect [![npm](https://img.shields.io/npm/v/@audio/denoise-detect)](https://www.npmjs.com/package/@audio/denoise-detect) [![MIT](https://img.shields.io/badge/MIT-%E0%A5%90-white)](https://github.com/krishnized/license)
2
+
3
+ denoise — content-aware auto-selector that classifies the dominant noise type
4
+
5
+ ```
6
+ npm install @audio/denoise-detect
7
+ ```
8
+
9
+ ```js
10
+ import denoise from '@audio/denoise-detect'
11
+ ```
12
+
13
+ Content-aware auto-selector. Runs a single STFT classification sweep over the input and dispatches to the most suitable method.
14
+
15
+ ```js
16
+ denoise(data) // → cleaned Float32Array
17
+ denoise(data, { returnPlan: true }) // → { out, plan }
18
+ denoise(data, { force: 'wiener' }) // skip classifier
19
+ ```
20
+
21
+ | Param | Default | |
22
+ |---|---|---|
23
+ | `fs` | `44100` | Sample rate |
24
+ | `force` | — | One of `'dehum' \| 'declick' \| 'dewind' \| 'deesser' \| 'dereverb' \| 'omlsa' \| 'wiener'` |
25
+ | `returnPlan` | `false` | Return `{ out, plan }` with classifier scores + chosen method |
26
+
27
+ **Routing (in priority order):**
28
+ 1. tonal hum (Goertzel — ≥2 of first 3 harmonics show 50× line/off-line ratio at 50 or 60 Hz)
29
+ 2. impulses (excess kurtosis of AR residual > 12)
30
+ 3. sibilance (high/mid band power ratio > 8)
31
+ 4. LF rumble (low/mid band power ratio > 3)
32
+ 5. non-stationary noise (frame-energy CV > 0.6) → omlsa
33
+ 6. otherwise → wiener
34
+
35
+ ---
36
+
37
+ Part of [@audio/denoise](https://github.com/audiojs/denoise) — the denoise family umbrella. This README is generated from the umbrella docs.
38
+
39
+ MIT © [audiojs](https://github.com/audiojs)
package/denoise.js CHANGED
@@ -20,9 +20,26 @@ import omlsa from '@audio/denoise-omlsa'
20
20
  import dehum from '@audio/denoise-dehum'
21
21
  import declick from '@audio/denoise-declick'
22
22
  import dewind from '@audio/denoise-dewind'
23
- import deesser from '@audio/denoise-deesser'
23
+ import deesser_ from '@audio/dynamics-deesser'
24
24
  import dereverb from '@audio/denoise-dereverb'
25
25
 
26
+ // deesser — @audio/dynamics-deesser mode 'band' behind this family's seconds/fs
27
+ // API (2026-07 near-dupe merge; small local adapter per workspace policy)
28
+ const deesser = (data, params = {}) => {
29
+ data.set(deesser_(data, {
30
+ sampleRate: params.fs || 44100,
31
+ mode: 'band',
32
+ freq: params.freq ?? 6000,
33
+ q: params.Q ?? 1.4,
34
+ threshold: params.threshold ?? -30,
35
+ ratio: params.ratio ?? 4,
36
+ attack: (params.attack ?? 0.001) * 1000,
37
+ release: (params.release ?? 0.05) * 1000,
38
+ block: params.block,
39
+ }))
40
+ return data
41
+ }
42
+
26
43
  export default function denoise(data, params = {}) {
27
44
  let fs = params.fs || 44100
28
45
  let force = params.force // skip classification
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audio/denoise-detect",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "denoise — content-aware auto-selector that classifies the dominant noise type",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -18,7 +18,7 @@
18
18
  "@audio/denoise-dehum": "^0.1.0",
19
19
  "@audio/denoise-declick": "^0.1.0",
20
20
  "@audio/denoise-dewind": "^0.1.0",
21
- "@audio/denoise-deesser": "^0.1.0",
21
+ "@audio/dynamics-deesser": "^0.2.3",
22
22
  "@audio/denoise-dereverb": "^0.1.0",
23
23
  "@audio/lpc": "^1.0.0",
24
24
  "@audio/stft": "^1.0.3"