@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.13 → 1.0.15
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.
|
@@ -23,7 +23,7 @@ class SpatialAudioManager extends EventManager_1.EventManager {
|
|
|
23
23
|
this.audioContext = new AudioContext({ sampleRate: 48000 });
|
|
24
24
|
// Master gain
|
|
25
25
|
this.masterGainNode = this.audioContext.createGain();
|
|
26
|
-
this.masterGainNode.gain.value =
|
|
26
|
+
this.masterGainNode.gain.value = 1.8; // Lower headroom to avoid hiss from boosted noise floor
|
|
27
27
|
// Compressor for dynamic range control and preventing distortion
|
|
28
28
|
this.compressor = this.audioContext.createDynamicsCompressor();
|
|
29
29
|
this.compressor.threshold.value = -24; // dB
|
|
@@ -340,8 +340,9 @@ class SpatialAudioManager extends EventManager_1.EventManager {
|
|
|
340
340
|
const smoothing = 0.2;
|
|
341
341
|
stability.smoothedLevel =
|
|
342
342
|
stability.smoothedLevel * (1 - smoothing) + normalizedLevel * smoothing;
|
|
343
|
-
const gateOpenThreshold = 0.
|
|
344
|
-
const gateCloseThreshold = 0.
|
|
343
|
+
const gateOpenThreshold = 0.028; // tuned for speech presence
|
|
344
|
+
const gateCloseThreshold = 0.012;
|
|
345
|
+
const noiseFloorGain = 0.12;
|
|
345
346
|
let targetGain = stability.targetGain;
|
|
346
347
|
if (stability.networkMuted) {
|
|
347
348
|
targetGain = 0;
|
|
@@ -350,13 +351,13 @@ class SpatialAudioManager extends EventManager_1.EventManager {
|
|
|
350
351
|
targetGain = 0;
|
|
351
352
|
}
|
|
352
353
|
else if (stability.smoothedLevel < gateOpenThreshold) {
|
|
353
|
-
targetGain =
|
|
354
|
+
targetGain = noiseFloorGain;
|
|
354
355
|
}
|
|
355
356
|
else {
|
|
356
357
|
targetGain = 1;
|
|
357
358
|
}
|
|
358
359
|
if (Math.abs(targetGain - stability.targetGain) > 0.05) {
|
|
359
|
-
const ramp = targetGain > stability.targetGain ? 0.
|
|
360
|
+
const ramp = targetGain > stability.targetGain ? 0.04 : 0.18;
|
|
360
361
|
noiseGate.gain.setTargetAtTime(targetGain, this.audioContext.currentTime, ramp);
|
|
361
362
|
stability.targetGain = targetGain;
|
|
362
363
|
}
|
|
@@ -652,7 +653,7 @@ class SpatialAudioManager extends EventManager_1.EventManager {
|
|
|
652
653
|
const normalized = (distance - config.refDistance) /
|
|
653
654
|
Math.max(config.maxDistance - config.refDistance, 0.001);
|
|
654
655
|
const shaped = Math.pow(Math.max(0, 1 - normalized), Math.max(1.2, config.rolloffFactor * 1.05));
|
|
655
|
-
return Math.min(1, Math.max(0.
|
|
656
|
+
return Math.min(1, Math.max(0.001, shaped));
|
|
656
657
|
}
|
|
657
658
|
normalizePositionUnits(position) {
|
|
658
659
|
const distanceConfig = this.getDistanceConfig();
|
|
@@ -852,7 +853,7 @@ registerProcessor('odyssey-denoise', OdysseyDenoiseProcessor);
|
|
|
852
853
|
release: 0.18,
|
|
853
854
|
};
|
|
854
855
|
const noiseGateDefaults = {
|
|
855
|
-
enabled:
|
|
856
|
+
enabled: true,
|
|
856
857
|
};
|
|
857
858
|
const outboundDefaults = {
|
|
858
859
|
enabled: false,
|
package/package.json
CHANGED