feat(sound): add SoundService and SettingsView#28
Merged
dinesh-git17 merged 1 commit intomainfrom Mar 5, 2026
Merged
Conversation
Centralized sound playback service with AVAudioPlayer-backed cue APIs for page turn, signature placed, and new content chime. Global sound preference persisted via UserDefaults with default enabled on first launch. SettingsView exposes deterministic toggle bound to SoundService state with optional environment injection for preview safety.
CI Health Report
Not triggered: API Sync Contract, Admin Smoke, Backend Quality, DB Schema Check, Dependabot Updates, Push Mock Integration, Release Readiness, iOS Assets & Theme Check, pages-build-deployment 4 passed | 0 failed | 0 other | Commit: |
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
Implements E8.1: Sound Service and Settings Toggle. Adds centralized AVAudioPlayer-backed sound playback service with named cue APIs for page turn, signature placed, and new content chime. Global sound preference persisted in UserDefaults (default: enabled). SettingsView provides deterministic toggle bound to SoundService state.
Design Doc Alignment
Changes
ExhibitA/ExhibitA/Core/SoundService.swift(created):@Observable final classwithCueenum,isSoundEnabledpersisted preference,play(_:)API, AVAudioPlayer preparation with graceful missing-asset handling.ExhibitA/ExhibitA/Features/Home/SettingsView.swift(created): Settings surface with sound toggle using@Bindablebinding to SoundService. Optional environment injection for preview safety. Theme-tokenized styling.ExhibitA/ExhibitA/App/ExhibitAApp.swift(updated): SoundService instantiation and.environment()injection.ExhibitA/ExhibitA.xcodeproj/project.pbxproj(updated): File references and build phase entries for both new files.Risk Surface
page_turn.caf,signature_placed.caf,new_content_chime.caf) are not yet in the bundle. SoundService handles this gracefully viaLogger.infoand no-op playback. Assets must be added before cues are audible.SoundService.play(_:)into contract, signature, and sync surfaces.Testing
xcodebuild -project ExhibitA.xcodeproj -scheme ExhibitA -sdk iphoneos build. Zero errors, zero code warnings../scripts/protocol-zero.shexit 0)../scripts/check-em-dashes.shexit 0).Protocol Zero
./scripts/protocol-zero.shexits 0.Typographic Lint
./scripts/check-em-dashes.shexits 0.