fix: bật AudioWorklet hết deprecation ScriptProcessor + signature guard applyMasteringSettings hết BiquadFilterNode state is bad
This commit is contained in:
@@ -76,6 +76,14 @@ function makeDistortionCurve(k) {
|
||||
|
||||
function applyMasteringSettings(s) {
|
||||
if (!masterBus || !audioCtx || !s) return;
|
||||
// getAudioContext() invokes this on EVERY call (stopAll, play, VU, …).
|
||||
// Re-applying identical values in rapid bursts is "fast parameter automation"
|
||||
// and makes Chromium flag the biquad EQ filters as unstable ("state is bad").
|
||||
// Only touch the graph when a value actually changed.
|
||||
const sig = [s.eqActive, s.eqLowGain, s.eqMid1Gain, s.eqMid2Gain, s.eqHighGain, s.imagerActive, s.w1, s.w2, s.w3, s.w4, s.maximizerActive, s.maxGain, s.maxSoftClip, s.maxUpward, s.ceiling].join('|');
|
||||
if (sig === _lastMasteringSig) return;
|
||||
_lastMasteringSig = sig;
|
||||
|
||||
const now = audioCtx.currentTime;
|
||||
// Clamp every parameter so a stale/incomplete settings object can never push
|
||||
// NaN or an extreme value into the biquad filters — that puts the master
|
||||
@@ -329,6 +337,7 @@ function setMasterVolume(linear) {
|
||||
}
|
||||
|
||||
let _lastMasteringActive = null;
|
||||
let _lastMasteringSig = null;
|
||||
function toggleMasteringOnMaster(activate, isBypassed) {
|
||||
if (!masterBus) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user