fix: use esm.sh CDN to resolve spessasynth_core bare import

- jdelivr raw index.js has bare import 'spessasynth_core' which browser can't resolve
- esm.sh automatically rewrites bare imports to full URLs
- Keep jdelivr for worklet processor (self-contained, no imports)
- WorkerSynthesizer fallback also uses esm.sh
This commit is contained in:
2026-07-26 18:09:12 +07:00
parent 0d1ef0f895
commit 09def59cac
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -68,7 +68,8 @@
} catch (e) {
console.warn("[SonicSF] SpessaSynth AudioWorklet init failed:", e, "- trying WorkerSynthesizer...");
try {
const { WorkerSynthesizer } = await import(window.__SpessaSynthCDN + "index.js");
const mod = await import("https://esm.sh/spessasynth_lib@4.3.1");
const WorkerSynthesizer = mod.WorkerSynthesizer;
_synthInstance = new WorkerSynthesizer(audioContext);
await _synthInstance.isReady;
_initialized = true;