Repository navigation
Add the sound to the golden_line example - #358
Merged
Merged
Conversation
A Web Audio implementation on miniaudio (core/web_audio.cpp, linked by donut_interop_shared) that follows Chrome's rendering: 128-frame quanta, commands taken at quantum starts, sources that compute their params only while sounding, Chrome's a-rate and k-rate setTargetAtTime recursions and event-time clamping. The soundbank and the sound engine (rails, loco, rolling, whistle, ambience, cabin) are ported from the original; their Web Audio calls match Chrome's over the whole ride. The HUD's sound button and the M key mute and unmute; -nosound turns the sound off, and -test never opens a device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
core/web_audio.cpp: Web Audio on miniaudio, following Chrome's rendering. It renders 128-frame quanta, with calls applied at each quantum start. It also mirrors these Chrome behaviours:setTargetAtTimeuse Chrome's recursions;It is linked into
donut_interop_sharedvia FetchContent, with a realtime or an offline context.core/golden_line_soundbank.tsandcore/golden_line_sound.ts: the original's soundbank and sound engine:The bank is built a few ms per frame, and the convolver impulses load a moment after the rest. Both modules pass the own memory model, with the shared desk, graph and RNG held as
Shared<T>.HUD sound button (on/off/unavailable icons) and the M key mute and unmute.
-nosoundturns sound off, and-testnever opens an audio device.Verification
Not ported
🤖 Generated with Claude Code