@tensamin/audio 0.1.5 → 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.
- package/dist/{chunk-XXTNAUYX.mjs → chunk-DF4AYGHJ.mjs} +1 -1
- package/dist/{chunk-VEJXAEMM.mjs → chunk-TLPO52HV.mjs} +10 -2
- package/dist/{chunk-GVKCBKW6.mjs → chunk-TWQJGBBU.mjs} +1 -1
- package/dist/{chunk-H5UKZU2Y.mjs → chunk-ZCC7ID7L.mjs} +1 -1
- package/dist/extensibility/plugins.js +10 -2
- package/dist/extensibility/plugins.mjs +2 -2
- package/dist/index.js +10 -2
- package/dist/index.mjs +4 -4
- package/dist/livekit/integration.js +10 -2
- package/dist/livekit/integration.mjs +4 -4
- package/dist/pipeline/audio-pipeline.js +10 -2
- package/dist/pipeline/audio-pipeline.mjs +3 -3
- package/dist/vad/vad-node.js +10 -2
- package/dist/vad/vad-node.mjs +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ var createEnergyVadWorkletCode = (vadConfig) => {
|
|
|
4
4
|
const smoothing = energyParams.smoothing ?? 0.95;
|
|
5
5
|
const initialNoiseFloor = energyParams.initialNoiseFloor ?? 1e-3;
|
|
6
6
|
const noiseFloorAdaptRateQuiet = energyParams.noiseFloorAdaptRateQuiet ?? 0.01;
|
|
7
|
-
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-
|
|
7
|
+
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-4;
|
|
8
8
|
const minSNR = energyParams.minSNR ?? 2;
|
|
9
9
|
const snrRange = energyParams.snrRange ?? 8;
|
|
10
10
|
return `
|
|
@@ -47,7 +47,15 @@ class EnergyVadProcessor extends AudioWorkletProcessor {
|
|
|
47
47
|
} else {
|
|
48
48
|
// Even during silence, if we detect a loud signal, adapt very slowly
|
|
49
49
|
// This could be brief noise we haven't classified as speech yet
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
// SAFEGUARD: If the signal is significantly louder than the noise floor (e.g. > 3x),
|
|
52
|
+
// assume it's unclassified speech or a sudden loud noise and DO NOT adapt.
|
|
53
|
+
// This prevents the noise floor from "chasing" the speech level during brief pauses or onsets.
|
|
54
|
+
const instantSnr = rms / (this.noiseFloor + 1e-6);
|
|
55
|
+
|
|
56
|
+
if (instantSnr < 3.0) {
|
|
57
|
+
this.noiseFloor = this.noiseFloor * (1 - this.noiseFloorAdaptRateLoud) + rms * this.noiseFloorAdaptRateLoud;
|
|
58
|
+
}
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
61
|
// During speech, freeze the noise floor to maintain consistent detection
|
|
@@ -107,7 +107,7 @@ var createEnergyVadWorkletCode = (vadConfig) => {
|
|
|
107
107
|
const smoothing = energyParams.smoothing ?? 0.95;
|
|
108
108
|
const initialNoiseFloor = energyParams.initialNoiseFloor ?? 1e-3;
|
|
109
109
|
const noiseFloorAdaptRateQuiet = energyParams.noiseFloorAdaptRateQuiet ?? 0.01;
|
|
110
|
-
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-
|
|
110
|
+
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-4;
|
|
111
111
|
const minSNR = energyParams.minSNR ?? 2;
|
|
112
112
|
const snrRange = energyParams.snrRange ?? 8;
|
|
113
113
|
return `
|
|
@@ -150,7 +150,15 @@ class EnergyVadProcessor extends AudioWorkletProcessor {
|
|
|
150
150
|
} else {
|
|
151
151
|
// Even during silence, if we detect a loud signal, adapt very slowly
|
|
152
152
|
// This could be brief noise we haven't classified as speech yet
|
|
153
|
-
|
|
153
|
+
|
|
154
|
+
// SAFEGUARD: If the signal is significantly louder than the noise floor (e.g. > 3x),
|
|
155
|
+
// assume it's unclassified speech or a sudden loud noise and DO NOT adapt.
|
|
156
|
+
// This prevents the noise floor from "chasing" the speech level during brief pauses or onsets.
|
|
157
|
+
const instantSnr = rms / (this.noiseFloor + 1e-6);
|
|
158
|
+
|
|
159
|
+
if (instantSnr < 3.0) {
|
|
160
|
+
this.noiseFloor = this.noiseFloor * (1 - this.noiseFloorAdaptRateLoud) + rms * this.noiseFloorAdaptRateLoud;
|
|
161
|
+
}
|
|
154
162
|
}
|
|
155
163
|
}
|
|
156
164
|
// During speech, freeze the noise floor to maintain consistent detection
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
getVADPlugin,
|
|
4
4
|
registerNoiseSuppressionPlugin,
|
|
5
5
|
registerVADPlugin
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-ZCC7ID7L.mjs";
|
|
7
7
|
import "../chunk-XO6B3D4A.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-TLPO52HV.mjs";
|
|
9
9
|
export {
|
|
10
10
|
getNoiseSuppressionPlugin,
|
|
11
11
|
getVADPlugin,
|
package/dist/index.js
CHANGED
|
@@ -159,7 +159,7 @@ var createEnergyVadWorkletCode = (vadConfig) => {
|
|
|
159
159
|
const smoothing = energyParams.smoothing ?? 0.95;
|
|
160
160
|
const initialNoiseFloor = energyParams.initialNoiseFloor ?? 1e-3;
|
|
161
161
|
const noiseFloorAdaptRateQuiet = energyParams.noiseFloorAdaptRateQuiet ?? 0.01;
|
|
162
|
-
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-
|
|
162
|
+
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-4;
|
|
163
163
|
const minSNR = energyParams.minSNR ?? 2;
|
|
164
164
|
const snrRange = energyParams.snrRange ?? 8;
|
|
165
165
|
return `
|
|
@@ -202,7 +202,15 @@ class EnergyVadProcessor extends AudioWorkletProcessor {
|
|
|
202
202
|
} else {
|
|
203
203
|
// Even during silence, if we detect a loud signal, adapt very slowly
|
|
204
204
|
// This could be brief noise we haven't classified as speech yet
|
|
205
|
-
|
|
205
|
+
|
|
206
|
+
// SAFEGUARD: If the signal is significantly louder than the noise floor (e.g. > 3x),
|
|
207
|
+
// assume it's unclassified speech or a sudden loud noise and DO NOT adapt.
|
|
208
|
+
// This prevents the noise floor from "chasing" the speech level during brief pauses or onsets.
|
|
209
|
+
const instantSnr = rms / (this.noiseFloor + 1e-6);
|
|
210
|
+
|
|
211
|
+
if (instantSnr < 3.0) {
|
|
212
|
+
this.noiseFloor = this.noiseFloor * (1 - this.noiseFloorAdaptRateLoud) + rms * this.noiseFloorAdaptRateLoud;
|
|
213
|
+
}
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
216
|
// During speech, freeze the noise floor to maintain consistent detection
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./chunk-WBQAMGXK.mjs";
|
|
2
2
|
import {
|
|
3
3
|
attachProcessingToTrack
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TWQJGBBU.mjs";
|
|
5
5
|
import {
|
|
6
6
|
createAudioPipeline
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DF4AYGHJ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
VADStateMachine
|
|
10
10
|
} from "./chunk-N553RHTI.mjs";
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
getVADPlugin,
|
|
22
22
|
registerNoiseSuppressionPlugin,
|
|
23
23
|
registerVADPlugin
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ZCC7ID7L.mjs";
|
|
25
25
|
import {
|
|
26
26
|
RNNoisePlugin
|
|
27
27
|
} from "./chunk-XO6B3D4A.mjs";
|
|
28
28
|
import {
|
|
29
29
|
EnergyVADPlugin
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-TLPO52HV.mjs";
|
|
31
31
|
export {
|
|
32
32
|
EnergyVADPlugin,
|
|
33
33
|
RNNoisePlugin,
|
|
@@ -128,7 +128,7 @@ var createEnergyVadWorkletCode = (vadConfig) => {
|
|
|
128
128
|
const smoothing = energyParams.smoothing ?? 0.95;
|
|
129
129
|
const initialNoiseFloor = energyParams.initialNoiseFloor ?? 1e-3;
|
|
130
130
|
const noiseFloorAdaptRateQuiet = energyParams.noiseFloorAdaptRateQuiet ?? 0.01;
|
|
131
|
-
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-
|
|
131
|
+
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-4;
|
|
132
132
|
const minSNR = energyParams.minSNR ?? 2;
|
|
133
133
|
const snrRange = energyParams.snrRange ?? 8;
|
|
134
134
|
return `
|
|
@@ -171,7 +171,15 @@ class EnergyVadProcessor extends AudioWorkletProcessor {
|
|
|
171
171
|
} else {
|
|
172
172
|
// Even during silence, if we detect a loud signal, adapt very slowly
|
|
173
173
|
// This could be brief noise we haven't classified as speech yet
|
|
174
|
-
|
|
174
|
+
|
|
175
|
+
// SAFEGUARD: If the signal is significantly louder than the noise floor (e.g. > 3x),
|
|
176
|
+
// assume it's unclassified speech or a sudden loud noise and DO NOT adapt.
|
|
177
|
+
// This prevents the noise floor from "chasing" the speech level during brief pauses or onsets.
|
|
178
|
+
const instantSnr = rms / (this.noiseFloor + 1e-6);
|
|
179
|
+
|
|
180
|
+
if (instantSnr < 3.0) {
|
|
181
|
+
this.noiseFloor = this.noiseFloor * (1 - this.noiseFloorAdaptRateLoud) + rms * this.noiseFloorAdaptRateLoud;
|
|
182
|
+
}
|
|
175
183
|
}
|
|
176
184
|
}
|
|
177
185
|
// During speech, freeze the noise floor to maintain consistent detection
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachProcessingToTrack
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-TWQJGBBU.mjs";
|
|
4
|
+
import "../chunk-DF4AYGHJ.mjs";
|
|
5
5
|
import "../chunk-N553RHTI.mjs";
|
|
6
6
|
import "../chunk-OZ7KMC4S.mjs";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ZCC7ID7L.mjs";
|
|
8
8
|
import "../chunk-XO6B3D4A.mjs";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-TLPO52HV.mjs";
|
|
10
10
|
export {
|
|
11
11
|
attachProcessingToTrack
|
|
12
12
|
};
|
|
@@ -126,7 +126,7 @@ var createEnergyVadWorkletCode = (vadConfig) => {
|
|
|
126
126
|
const smoothing = energyParams.smoothing ?? 0.95;
|
|
127
127
|
const initialNoiseFloor = energyParams.initialNoiseFloor ?? 1e-3;
|
|
128
128
|
const noiseFloorAdaptRateQuiet = energyParams.noiseFloorAdaptRateQuiet ?? 0.01;
|
|
129
|
-
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-
|
|
129
|
+
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-4;
|
|
130
130
|
const minSNR = energyParams.minSNR ?? 2;
|
|
131
131
|
const snrRange = energyParams.snrRange ?? 8;
|
|
132
132
|
return `
|
|
@@ -169,7 +169,15 @@ class EnergyVadProcessor extends AudioWorkletProcessor {
|
|
|
169
169
|
} else {
|
|
170
170
|
// Even during silence, if we detect a loud signal, adapt very slowly
|
|
171
171
|
// This could be brief noise we haven't classified as speech yet
|
|
172
|
-
|
|
172
|
+
|
|
173
|
+
// SAFEGUARD: If the signal is significantly louder than the noise floor (e.g. > 3x),
|
|
174
|
+
// assume it's unclassified speech or a sudden loud noise and DO NOT adapt.
|
|
175
|
+
// This prevents the noise floor from "chasing" the speech level during brief pauses or onsets.
|
|
176
|
+
const instantSnr = rms / (this.noiseFloor + 1e-6);
|
|
177
|
+
|
|
178
|
+
if (instantSnr < 3.0) {
|
|
179
|
+
this.noiseFloor = this.noiseFloor * (1 - this.noiseFloorAdaptRateLoud) + rms * this.noiseFloorAdaptRateLoud;
|
|
180
|
+
}
|
|
173
181
|
}
|
|
174
182
|
}
|
|
175
183
|
// During speech, freeze the noise floor to maintain consistent detection
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAudioPipeline
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DF4AYGHJ.mjs";
|
|
4
4
|
import "../chunk-N553RHTI.mjs";
|
|
5
5
|
import "../chunk-OZ7KMC4S.mjs";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-ZCC7ID7L.mjs";
|
|
7
7
|
import "../chunk-XO6B3D4A.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-TLPO52HV.mjs";
|
|
9
9
|
export {
|
|
10
10
|
createAudioPipeline
|
|
11
11
|
};
|
package/dist/vad/vad-node.js
CHANGED
|
@@ -28,7 +28,7 @@ var createEnergyVadWorkletCode = (vadConfig) => {
|
|
|
28
28
|
const smoothing = energyParams.smoothing ?? 0.95;
|
|
29
29
|
const initialNoiseFloor = energyParams.initialNoiseFloor ?? 1e-3;
|
|
30
30
|
const noiseFloorAdaptRateQuiet = energyParams.noiseFloorAdaptRateQuiet ?? 0.01;
|
|
31
|
-
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-
|
|
31
|
+
const noiseFloorAdaptRateLoud = energyParams.noiseFloorAdaptRateLoud ?? 1e-4;
|
|
32
32
|
const minSNR = energyParams.minSNR ?? 2;
|
|
33
33
|
const snrRange = energyParams.snrRange ?? 8;
|
|
34
34
|
return `
|
|
@@ -71,7 +71,15 @@ class EnergyVadProcessor extends AudioWorkletProcessor {
|
|
|
71
71
|
} else {
|
|
72
72
|
// Even during silence, if we detect a loud signal, adapt very slowly
|
|
73
73
|
// This could be brief noise we haven't classified as speech yet
|
|
74
|
-
|
|
74
|
+
|
|
75
|
+
// SAFEGUARD: If the signal is significantly louder than the noise floor (e.g. > 3x),
|
|
76
|
+
// assume it's unclassified speech or a sudden loud noise and DO NOT adapt.
|
|
77
|
+
// This prevents the noise floor from "chasing" the speech level during brief pauses or onsets.
|
|
78
|
+
const instantSnr = rms / (this.noiseFloor + 1e-6);
|
|
79
|
+
|
|
80
|
+
if (instantSnr < 3.0) {
|
|
81
|
+
this.noiseFloor = this.noiseFloor * (1 - this.noiseFloorAdaptRateLoud) + rms * this.noiseFloorAdaptRateLoud;
|
|
82
|
+
}
|
|
75
83
|
}
|
|
76
84
|
}
|
|
77
85
|
// During speech, freeze the noise floor to maintain consistent detection
|
package/dist/vad/vad-node.mjs
CHANGED