Repository navigation
feat(audio): zen-wood SFX + BGM assets, audio now audible (#330 P3) - #444
Merged
Merged
Conversation
P1/P2 wired GameAudio.LiveSoundPlayer to resolve each `soundKey` from `Bundle.main` but shipped no assets, so gameplay audio silently no-op'd. P3 drops the zen-wood palette into both app bundles, with each filename stem matching the soundKey the apps fire. Sudoku (App/Sudoku/Resources/Audio/): place / complete / error / win (SFX) + gameplay (BGM, from zen-wood bgm) Minesweeper (App/Minesweeper/Resources/Audio/): reveal / flag / floodClear / explosion / win (SFX) + bgm (BGM) Assets are generated by the gitignored build/audio-demos/gen_palettes.py zen-wood palette (pure-numpy synth, royalty-free). Format note: LiveSoundPlayer.audioURL(for:) resolves a soundKey across [caf, wav, m4a, aif, aiff, mp3] from the injected bundle. Assets ship as 16-bit PCM mono 44.1kHz WAV (AVAudioPlayer plays natively); the BGM loops ~8s. afconvert to .caf/.m4a was unavailable in this environment, and WAV is in the resolver's extension set, so playback is unaffected. Project.swift globs App/<App>/Resources/Audio/** into each app target; verified via `tuist generate` (both targets reference all 11 files) and a new `mise run verify:audio` task that asserts every soundKey resolves to a non-empty asset whose stem == the soundKey. Co-Authored-By: Wei18 <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]>
afconvert was denied in the implementing agent's sandbox; re-encoding the two ~710KB uncompressed BGM loops to AAC-in-CAF (resolver tries .caf first; gapless-friendly) before merge avoids committing ~1.3MB of throwaway WAV. Short SFX stay WAV for low-latency one-shots. Co-Authored-By: Wei18 <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Jun 9, 2026
wei18
added a commit
that referenced
this pull request
Jun 9, 2026
…on banner-seam note (#445) Reflect the post-#442 work: #330 audio CLOSED (P3 #444), real shared banner #441/#443. Meeting log decisions/open-questions updated; mise-task-operations index gains verify:audio; monetization-sdk-integration records the GADBannerView -> AnyView cross-target seam + the #if DEBUG/Release ID split (supersedes the old REPLACE_IN_v2.5.3 placeholder). Co-authored-by: Claude Opus 4.8 <[email protected]>
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.
#330 P3 — zen-wood audio assets (audio now audible)
P1/P2 wired
GameAudio.LiveSoundPlayerto resolve eachsoundKeyfromBundle.main, but shipped no assets — everyplay()/playMusic()hit the tolerated missing-asset path and silently no-op'd. P3 drops the zen-wood palette into both app bundles so gameplay audio actually plays. Engine/wiring unchanged.How LiveSoundPlayer resolves a soundKey
audioURL(for:)searches the injected bundle (default.main) across, in order:via
bundle.url(forResource: key, withExtension: ext). So an asset loads iff its filename stem == the soundKey and its extension is in that set.Assets per app (stem == soundKey)
Sudoku —
App/Sudoku/Resources/Audio/place(SFX)complete(SFX)error(SFX)win(SFX)gameplay(BGM, ~8s loop)Minesweeper —
App/Minesweeper/Resources/Audio/reveal(SFX)flag(SFX)floodClear(SFX)explosion(SFX)win(SFX)bgm(BGM, ~8s loop)Generated by the gitignored
build/audio-demos/gen_palettes.pyzen-wood palette (pure-numpy synthesis, royalty-free). Sudoku BGM issudoku/zen-wood/bgm.wavrenamed to thegameplaysoundKey; Minesweeper BGM keeps thebgmsoundKey.Format choice
Assets ship as 16-bit PCM mono 44.1kHz WAV (validated via the Python
wavemodule: ch=1, 16-bit, 44100Hz).AVAudioPlayerplays WAV natively andwavis in the resolver's extension list, so playback is unaffected.The spec preferred
afconvert→ SFX.caf(LEI16/caff) + BGM.m4a(AAC).afconvert/afinfowere hard-denied in this sandboxed environment, so conversion wasn't possible here. WAV is the pragmatic, resolver-compatible fallback; a follow-up can re-encode to.caf/.m4ato shrink the BGM (710KB → ~120KB AAC) if bundle size matters. The resolver needs no change either way.Project.swift
Each app target now globs
App/<App>/Resources/Audio/**intoresources:(mirrors the existingSettings.bundleglob style). Only the banner files are untouched per scope.Verification (all green)
tuist generate --no-open✔ — generatedGame.xcodeprojreferences all 11 audio files; 22 "in Resources" build-file entries (11 per-target memberships) confirm both app targets bundle them.swift test✔ GameAudioKit (15), SudokuKit (220), MinesweeperKit (127) — all pass.mise run verify:audio✔ — asserts every soundKey (Sudoku place/complete/error/win/gameplay + Minesweeper reveal/flag/floodClear/explosion/win/bgm) resolves to a non-empty asset whose stem == the soundKey, using the same extension set LiveSoundPlayer uses. Output:audio verify PASS.mise run scan:l10n✔ —L10n gate passed.Headless audio playback can't be unit-tested, so verification covers file presence + naming + resolver-extension match + bundle membership.
🤖 Generated with Claude Code