diff --git a/web/world/js/skyfx.js b/web/world/js/skyfx.js index 2c63773..030576e 100644 --- a/web/world/js/skyfx.js +++ b/web/world/js/skyfx.js @@ -168,6 +168,19 @@ function createAudio(seed = 1) { return { get ready() { return started; }, + /** 'running' | 'suspended' | 'closed' | 'none'. `ready` only means the graph + * got built — a suspended context is still silent, so the HUD reports this. */ + get state() { return ctx ? ctx.state : 'none'; }, + /** Current layer gains — for the HUD and for asserting the bed tracks wind. */ + levels() { + if (!started) return null; + return { + wind: +windGain.gain.value.toFixed(4), + howl: +howlGain.gain.value.toFixed(4), + rain: +rainGain.gain.value.toFixed(4), + cutoff: Math.round(windFilter.frequency.value), + }; + }, /** Call from the first click/keydown. Safe to call repeatedly. */ unlock() { diff --git a/web/world/weather_demo.html b/web/world/weather_demo.html index 8a67a0e..0c5801f 100644 --- a/web/world/weather_demo.html +++ b/web/world/weather_demo.html @@ -247,7 +247,7 @@ function frame(now) {