fix: bật AudioWorklet hết deprecation ScriptProcessor + signature guard applyMasteringSettings hết BiquadFilterNode state is bad
This commit is contained in:
@@ -86,14 +86,15 @@
|
||||
|
||||
console.log("[SonicSF] AudioCtx state:", _audioCtx.state, "sampleRate:", _audioCtx.sampleRate);
|
||||
|
||||
// ScriptProcessor is the proven-stable renderer in this app.
|
||||
// The AudioWorklet path (fluidsynth-bridge) is implemented and
|
||||
// mono-safe, but it caused device-specific audio failures, so
|
||||
// keep it opt-in (flip to false to try it) — the deprecation
|
||||
// console warning is cosmetic.
|
||||
var _useScriptNode = true;
|
||||
// Use the AudioWorklet (fluidsynth-bridge) — ScriptProcessor
|
||||
// is deprecated and logs a console warning. The worklet is
|
||||
// now mono-safe (handles 1/2/N channel outputs) and the node
|
||||
// is forced stereo, and the URL is cache-busted so the fixed
|
||||
// module always loads. Falls back to ScriptProcessor if the
|
||||
// worklet cannot be created (older browsers).
|
||||
var _useScriptNode = false;
|
||||
try {
|
||||
await _audioCtx.audioWorklet.addModule('/static/js/worklets/fluidsynth-bridge.js?v=202608031240');
|
||||
await _audioCtx.audioWorklet.addModule('/static/js/worklets/fluidsynth-bridge.js?v=202608031315');
|
||||
console.log("[SonicSF] Worklet registered OK");
|
||||
} catch (e) {
|
||||
console.warn("[SonicSF] Worklet reg failed:", e);
|
||||
|
||||
Reference in New Issue
Block a user