fix: serve SpessaSynth processor locally to avoid CDN version mismatch

- Download spessasynth_processor.min.js from CDN, serve as static file
- Change __SpessaSynthCDN to /static/js/services/
- Fix version mismatch between esm.sh library and CDN processor
This commit is contained in:
2026-07-26 18:47:32 +07:00
parent c884f3c533
commit 4d42b8407c
3 changed files with 25 additions and 4 deletions
+6 -3
View File
@@ -107,9 +107,12 @@
const bufCopy = buffer.slice(0);
await _synthInstance.soundBankManager.addSoundBank(bufCopy, sfId);
await _synthInstance.isReady;
// Force program 0 on channel 0 to activate loaded bank
this.controllerChange(0, 0, 0);
this.programChange(0, 0);
// Force bank+program select on all channels to activate loaded bank
for (let ch = 0; ch < 16; ch++) {
try { _synthInstance.controllerChange(ch, 0, 0); } catch (e) {}
try { _synthInstance.controllerChange(ch, 32, 0); } catch (e) {}
try { _synthInstance.programChange(ch, 0); } catch (e) {}
}
_currentSfId = sfId;
console.log("[SonicSF] SoundFont loaded:", sfId);
} catch (e) {
File diff suppressed because one or more lines are too long