#475

Play cue sounds for task start, approval, completion and failure

OpenJosssphZhouwants to merge intofrom

What changes for people

Poki plays a short cue at four moments so nobody has to watch the screen: a task starts, an approval card appears, a task completes, a task fails. The cues follow the silent switch and the system volume, and they never take over audio from another app. Settings has a new Sound Effects switch (on by default, kept across launches). Events that happen while it is off are not played later.

What changes in the code

  • CueSounds maps events to cues once each (one id per task, one per approval). SystemCueOutput prepares system sound IDs on a background queue at launch, so sending a task does no file reads or decoding. A missing or refused sound file only logs.
  • The chat model plays start when a task begins and complete or failed when it ends. A stopped task plays neither.
  • Approval cue is played where the app first shows the approval, once per approval id. The approval notification and the Live Activity approval and quiet-stretch alerts are silenced so the same approval does not sound twice.
  • The four sounds are the CC0 minimal set from UI SFX by Yuki Capital, with PCM CAF copies for System Sound Services. Source, license and conversion notes are in Resources/CueSounds, and THIRD_PARTY_NOTICES.md has an entry.
  • project-base.yml excludes the notes and MP3 originals from the bundle (the CAFs ship), which fixes a duplicate README.md build output.

Verification

Run on a fresh iOS 27.0 simulator:

  • The two event-mapping and off-switch tests failed against a stubbed player (nothing played), then passed against the real one.
  • Three tests drive the real chat and app models against a scripted endpoint and record what reaches the playback boundary: start, notification, complete for one task (a repeated approval event stays silent), start, blocked for a failing endpoint, only start when a task is stopped, and a bundle without sounds does not crash.
  • Settings screenshots in English and Simplified Chinese with the switch on, and after a relaunch with it off. The switch text is not truncated.

Not verified: sound on a physical phone, the silent resource for Live Activity alerts on a real device, and send-to-first-action timing (not measured).

Try it on a phone

  1. Install this build, open Settings and confirm Sound Effects is on.
  2. Send a task that needs an approval and listen for start, then the approval cue, then complete. Put the phone on silent and check nothing plays.
  3. Turn Sound Effects off, run another task, and check it is quiet.

🤖 Generated with Claude Code