From d10ffca4e863536c8114c0758c88571544a98baf Mon Sep 17 00:00:00 2001 From: BenStullsBets Date: Tue, 30 Jun 2026 09:06:41 -0700 Subject: [PATCH] =?UTF-8?q?fix(audio):=20route=20scaleAudioUrl=20through?= =?UTF-8?q?=20mediaBase=20=E2=80=94=20was=20hardcoded=20/media=20(404=20on?= =?UTF-8?q?=20static)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The audio layer built the soundtrack url as a literal /media/audio/, which 404s on the static R2 build (audio err 4, silent). Route it through mediaBase() like the video path: dev → /media/ (unchanged), static → https://static.benstull.art/. Verified live: aud loads 200 from R2 and plays. Co-Authored-By: Claude Opus 4.8 (1M context) --- simulator/static/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/simulator/static/app.js b/simulator/static/app.js index e2aedf4..ed3eb9b 100644 --- a/simulator/static/app.js +++ b/simulator/static/app.js @@ -1192,7 +1192,10 @@ function scaleAudioUrl(index) { if (!ring || !ring.scales.length) return null; const s = ring.scales[HEFScrub.wrapIndex(index, ring.scales.length)]; const a = s.audio || SCALE_AUDIO_FALLBACK[s.id]; - return a ? "/media/audio/" + a : null; + // Route through mediaBase() so audio loads from R2 in the static build (and the + // local /media mount in dev) — NOT a hardcoded /media path, which 404s on the + // static site. mediaUrl() then passes this absolute url straight through. + return a ? mediaBase() + "audio/" + a : null; } // The current resting altitude's soundtrack url (kept for the status readout). function soundtrackUrl() { return scaleAudioUrl(ringIndex); }