Repository navigation
Fix silent audio on deployed site and add sound toggle - #168
Merged
Merged
Conversation
- Unlock audio from the Play click: AudioContext.resume() and audio.play() start before the handler yields, so deployed HTTPS origins allow sound. - Never route <audio> elements through a MediaElementSource, which plays silence for cross-origin tracks without CORS headers. - Load raw films via srcdoc with sandbox="allow-scripts allow-same-origin" and wait for the iframe load event plus a motifySoundtrack function check before running OfflineAudioContext.startRendering(). - Render a local WAV fallback when the server-side soundtrack is missing. - Add [Audio] console diagnostics (soundtrack found, WAV duration/peak, AudioContext state on play). - Add a sound on/off button next to Play. - Include pending generation-progress UI fixes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The fetch stub wrapped a jsdom Blob in a Response, which Node 20 rejects; the code under test swallowed the rejection, so CI saw empty font CSS. Use a string body with a content-type header instead.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audio played locally but was silent on the Railway deployment. This PR fixes it:
AudioContext.resume()andaudio.play()synchronously from the click handler, before the firstawait, so the browser treats them as part of the user gesture.<audio>elements: aMediaElementSourceon a cross-origin track served without CORS headers outputs silence, so elements now play directly and the context is only resumed.srcdocwithsandbox="allow-scripts allow-same-origin".loadevent and checkstypeof motifySoundtrack === 'function'beforeOfflineAudioContext.startRendering(). If the server-side WAV is missing, a local WAV fallback is rendered.[Audio] motifySoundtrack found,[Audio] WAV rendered (duration, peak amplitude), and[Audio] AudioContext state on play.Test plan
npm run type-checknpm run buildnpm run test:run(646 passed)[Audio]logs and sound plays🤖 Generated with Claude Code