Repository navigation
fix(sound): stabilize wheel hover feedback and validate custom WAV - #172
Merged
Merged
Conversation
- Stabilize wheel hover sound scheduling: - Isolate hover candidate evaluation and debouncing per wheel interaction session. - Eliminate inter-session state leakage and lingering debounce timers across gestures, sticky sessions, and preview canvas. - Enforce minimum playback interval (80ms) and discard stale candidates before playback claim. - Guarantee immediate action execution preempts pending hover sounds without race conditions. - Robust custom RIFF/WAVE parsing: - Parse RIFF/WAVE chunk hierarchy, correctly locating the 'data' chunk rather than assuming a fixed 44-byte header. - Support arbitrary metadata chunks (e.g., JUNK, LIST) before or after 'data', properly handling odd-sized chunk padding bytes. - Strictly validate format (16-bit PCM, 1 or 2 channels), byte rate (sampleRate * blockAlign with 64-bit overflow check), and chunk bounds. - Reject corrupted, truncated, or duplicate 'data' chunks, gracefully falling back to synthesized sounds with clear error recording. - Scale audio samples non-destructively without modifying source arrays. - Test coverage and Headless CI: - Add comprehensive automated forensics test suite (275 tests) in scratch/test_sound_forensics.cs with headless mock sound sink and zero physical audio playback. - Provide scratch/run_10_cycles.ps1 for multi-cycle regression verification (10/10 cycles passed). - Integrate sound forensics suite into .github/workflows/build-and-test.yml as a blocking CI gate.
Collaborator
Author
|
用户已报告本机人工验收通过。 |
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 of Changes
This PR stabilizes StarPie's wheel hover sound scheduling and introduces robust RIFF/WAVE parsing and volume scaling for custom sound effects (addressing
SP-SOUND-001).1. Wheel Hover Feedback Stabilization
GestureController,StickyWheelSession, and preview canvas inSettingsWindow). Prevents stale candidates or active timers from one interaction leaking into another.ActionExecute) immediately cancels pending hover candidates, ensuring immediate execution feedback.2. Robust RIFF/WAVE Parsing & PCM Volume Scaling
datachunk instead of assuming a fixed 44-byte header offset.JUNK,LIST,INFO) whether located before or after the audiodatachunk. Correctly respects odd-length chunk padding bytes.byteRate == sampleRate * blockAlignwith 64-bit overflow guards.datachunks, recording descriptive fallback reasons in diagnostic properties and safely falling back to synthesized sounds. Audio samples are scaled non-destructively without mutating the source byte array.3. Verification & Headless CI Integration
scratch/test_sound_forensics.cs) covering concurrency, race conditions, chunk parsing edge cases, and corruption fallbacks using mock sinks (--test-instance). Zero physical audio playback and zero UI interference during automated test execution.scratch/run_10_cycles.ps1. Passed 10/10 consecutive test cycles (100% pass rate, 2,750 assertions without failure)..github/workflows/build-and-test.ymlas a blocking Release-mode check on Windows.Testing & Hardware Notice
Note
All unit and concurrency assertions were executed against headless mock playback sinks and test seams (
TestMode = true).While software-level scheduling races and buffer parsing bugs are fully validated by the automated test suite, real-world acoustic behavior can vary across physical sound cards, DACs, and audio drivers. Human verification with physical speakers/headphones on varied hardware setups is recommended prior to release tagging.
Rollback & Safety
EnableSoundEffects = falseinconfig.json).