@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.352 → 1.0.353
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/audio/MLNoiseSuppressor.js +16 -14
- package/package.json +1 -1
|
@@ -1122,22 +1122,24 @@ class MLNoiseSuppressor {
|
|
|
1122
1122
|
gains[k] = filtTotal[k] > 1e-8 ? gains[k] / filtTotal[k] : 1.0;
|
|
1123
1123
|
gains[k] = Math.max(0.0, Math.min(1.0, gains[k]));
|
|
1124
1124
|
}
|
|
1125
|
-
// ── Step 5:
|
|
1126
|
-
//
|
|
1127
|
-
//
|
|
1128
|
-
//
|
|
1125
|
+
// ── Step 5: Speech-band protection floor ──────────────────────────────
|
|
1126
|
+
// β=1.8 power law was crushing voice to 12% amplitude (mean IRM=0.12
|
|
1127
|
+
// across 257 bins) — user heard noise only, no voice. Root cause:
|
|
1128
|
+
// β^1.8 was computed before STFT was applied (binary gate hid the damage);
|
|
1129
|
+
// now that per-bin STFT gains are real, voice must be protected.
|
|
1129
1130
|
//
|
|
1130
|
-
//
|
|
1131
|
-
// This is mathematically equivalent to Wiener spectral subtraction and
|
|
1132
|
-
// is used by every production noise suppressor (RNNoise, Google, WebRTC).
|
|
1131
|
+
// During speech frames: enforce minimum gain of 0.20 on all bins.
|
|
1133
1132
|
// Effect:
|
|
1134
|
-
// IRM
|
|
1135
|
-
//
|
|
1136
|
-
//
|
|
1137
|
-
//
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1133
|
+
// Speech fundamental (raw IRM≈0.86) → 0.86 (unchanged, full voice)
|
|
1134
|
+
// Speech formants (raw IRM≈0.65) → 0.65 (unchanged, full voice)
|
|
1135
|
+
// Mixed fan+speech (raw IRM≈0.30) → 0.30 (−10dB vs binary gate)
|
|
1136
|
+
// Pure fan bins (raw IRM≈0.10) → 0.20 (−14dB vs binary gate)
|
|
1137
|
+
// During noise frames: no floor — model can suppress to full silence.
|
|
1138
|
+
const IRM_SPEECH_FLOOR = 0.2;
|
|
1139
|
+
if (isSpeechFrame) {
|
|
1140
|
+
for (let k = 1; k < bins; k++) {
|
|
1141
|
+
gains[k] = Math.max(IRM_SPEECH_FLOOR, gains[k]);
|
|
1142
|
+
}
|
|
1141
1143
|
}
|
|
1142
1144
|
// ── Step 6: Override gains[0] as explicit gate signal ────────────────
|
|
1143
1145
|
// The DC bin (k=0) has no mel filter coverage → filtTotal[0] ≤ 1e-8 →
|
package/package.json
CHANGED