fix: use importmap to resolve spessasynth_core bare import

- Add importmap in index.html to map spessasynth_core to CDN URL
- Load spessasynth_lib from CDN directly (with importmap resolving deps)
- WorkerSynthesizer fallback also uses CDN import
- Ensures library and processor use same spessasynth_core version
This commit is contained in:
2026-07-26 18:55:08 +07:00
parent 50847fc440
commit 263c4be409
2 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -67,7 +67,7 @@
_initInProgress = false;
console.warn("[SonicSF] AudioWorklet failed, trying WorkerSynthesizer:", e);
try {
const mod = await import("https://esm.sh/spessasynth_lib@4.3.1");
const mod = await import("https://cdn.jsdelivr.net/npm/spessasynth_lib@4.3.1/dist/index.js");
_synthInstance = new mod.WorkerSynthesizer(audioContext);
await _synthInstance.isReady;
_initialized = true;