FEAT: thêm Mixer Panel display

This commit is contained in:
2026-07-29 09:54:21 +07:00
parent b00f0cff95
commit caa95177ef
3 changed files with 588 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
diff --git a/app/static/js/services/soundfontPlayer.js b/app/static/js/services/soundfontPlayer.js
index bb0a556..e85c936 100644
--- a/app/static/js/services/soundfontPlayer.js
+++ b/app/static/js/services/soundfontPlayer.js
@@ -130,6 +130,7 @@
if (_useScriptNode) {
var spBufSz = 2048;
var spn = _audioCtx.createScriptProcessor(spBufSz, 0, 2);
+ getCtx();
var lp = _fluidModule._malloc(spBufSz * 4);
var rp = _fluidModule._malloc(spBufSz * 4);
spn.onaudioprocess = function (e) {
@@ -151,6 +152,11 @@
console.log("[SonicSF] ScriptProcessorNode fallback active (buf:", spBufSz, ")");
}
+ // Re-route through mixer graph if it exists (created before SonicSF was ready)
+ if (window.__mixerGraphManager && typeof SonicSF.setOutputNode === 'function') {
+ SonicSF.setOutputNode(window.__mixerGraphManager.masterGain);
+ }
+
_initialized = true;
console.log("[SonicSF] FluidSynth WASM Engine initialized.");
} catch (e) {