FIX: sửa volume main out
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
if (!_gainNode) {
|
||||
_gainNode = ctx.createGain();
|
||||
_gainNode.gain.value = 0.3;
|
||||
_gainNode.connect(ctx.destination);
|
||||
_gainNode.connect(window.masterBus ? window.masterBus.input : ctx.destination);
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
@@ -119,8 +119,8 @@
|
||||
if (!_useScriptNode) {
|
||||
try {
|
||||
_workletNode = new AudioWorkletNode(_audioCtx, 'fluidsynth-bridge');
|
||||
_workletNode.connect(_audioCtx.destination);
|
||||
console.log("[SonicSF] AudioWorklet node connected");
|
||||
_workletNode.connect(_gainNode);
|
||||
console.log("[SonicSF] AudioWorklet node connected via gain");
|
||||
_startRenderLoop();
|
||||
} catch (e) {
|
||||
console.warn("[SonicSF] AudioWorkletNode failed:", e);
|
||||
@@ -146,9 +146,9 @@
|
||||
}
|
||||
} catch (er) {}
|
||||
};
|
||||
spn.connect(_audioCtx.destination);
|
||||
spn.connect(_gainNode);
|
||||
_workletNode = spn;
|
||||
console.log("[SonicSF] ScriptProcessorNode fallback active (buf:", spBufSz, ")");
|
||||
console.log("[SonicSF] ScriptProcessorNode connected via gain (buf:", spBufSz, ")");
|
||||
}
|
||||
|
||||
_initialized = true;
|
||||
|
||||
Reference in New Issue
Block a user