Skip to content

fix(sound): wait for sound samples to load and drop stale pack loads - #896

Merged
LeanBitLab merged 1 commit into
mainfrom
fix/sound-pack-loading
Nov 22, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
fix/sound-pack-loading

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Reported on Telegram: sometimes no sound after choosing a sound effect.

  • First preview after picking a pack was silent: SoundPool.load is async and play ran before decoding finished. The preview now plays from the load-complete listener.
  • Key presses during pack loading were silently dropped; they now fall back to the system click until samples are ready.
  • Load jobs superseded by a newer pack or a released pool no longer publish stale sample IDs (generation check).
  • Cached sound toggles (e.g. play over Bluetooth) refresh on settings changes.
  • Decode failures and empty packs are logged.

Verified: assembleStandardDebug builds. Not yet tested on device.

SoundPool.load is asynchronous, so the first preview after picking a pack and key presses during loading were silently dropped. Play the preview when the sample is decoded, fall back to the system click until pack samples are ready, ignore load jobs superseded by a newer pack or a released pool, and refresh cached sound toggles on settings changes.
@LeanBitLab
LeanBitLab merged commit ac3fce7 into main Nov 22, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/sound-pack-loading branch November 22, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant