fix: SpessaSynth init retry + default SF3 auto-load
- getAudioContext() calls SonicSF.init on every call (not just first) - soundfontPlayer.init retries after 1s if SpessaSynth module not loaded yet - Auto-loads sgm_v2.01 SF3 on successful init - Fixes race condition: module script loads after regular scripts
This commit is contained in:
@@ -37,13 +37,13 @@ function getAudioContext() {
|
||||
if (window.SonicAudio && window.SonicAudio.initAudioWorklet) {
|
||||
window.SonicAudio.initAudioWorklet();
|
||||
}
|
||||
if (window.SonicSF && window.SonicSF.init) {
|
||||
window.SonicSF.init(audioCtx);
|
||||
}
|
||||
}
|
||||
if (audioCtx.state === 'suspended') {
|
||||
audioCtx.resume();
|
||||
}
|
||||
if (window.SonicSF && window.SonicSF.init) {
|
||||
window.SonicSF.init(audioCtx);
|
||||
}
|
||||
return audioCtx;
|
||||
}
|
||||
const formatTime = secs => {
|
||||
|
||||
Reference in New Issue
Block a user