6737a936dfc75b67311d8939fecbd4dd82ab4dc7
Eliminates per-sound async decodeAudioData latency and lazy SoundFont loading delays in the TeaVM webclient while preserving main-thread FluidSynth audio stability.
### Web Audio Pipeline
- src/main/webapp/index.html:
- Added decodeWav8MonoSync(ctx, bytes) to decode 8-bit unsigned mono PCM WAVs from Sounds.java synchronously into an AudioBuffer with decodeAudioData fallback.
- Added preloadFluidSynthAssets() on page load to initialize JSSynth and fetch TimGM6mb.sf2 before the first user gesture, and added midiPlaySeq cancellation across async playMidi() steps.
- Configured AudioContext with { latencyHint: 'interactive' }, guarded playPcm() against suspended contexts, and kept FluidSynth ScriptProcessorNode at 4096 samples to avoid main-thread underruns.
- src/main/java/org/scape2006/web/DesktopHooks.java:
- Skipped JS sound marshaling when vol <= 0.0f and forwarded delayMs to window.scapeWebAudio.playPcm(arr, vol, delayMs).
- src/main/webapp/sw.js:
- Bumped CACHE_VERSION to 2006scape-web-v6 to invalidate stale cached web assets.
Languages
Java
74.5%
HTML
24.3%
JavaScript
1.2%