Skip to content

Fix focus box lingering - #3

Open
kiera-dev wants to merge 3 commits into
mainfrom
fix-focus-box-lingering
Open

Fix focus box lingering#3
kiera-dev wants to merge 3 commits into
mainfrom
fix-focus-box-lingering

Conversation

@kiera-dev

Copy link
Copy Markdown
Owner

Fix focus box lingering, add clipping detection and mic gain control

What changed

Focus box fix — the yellow focus box stayed pinned on screen for as
long as AE/AF lock was active, which read as stuck UI. It now fades like
a normal focus box, and the AE/AF LOCK badge carries the lock state.

Clipping detection — the mic meter measured RMS, which sits 10–15 dB
below peak on dense music. It read comfortable green while a live concert
recording clipped from start to finish. Now:

  • The meter measures true peak, with a slow-falling peak-hold tick
  • Full-scale samples are counted and surfaced as a CLIP badge, reset per take
  • A full-screen overload warning plus a warning haptic — at a show you're
    watching the band, not the screen
  • A one-tap "too loud for Raw → switch to Stereo" button when clipping while idle

Input gain control — a slider in Raw mode, shown only when
AVAudioSession.isInputGainSettable reports true. Analog attenuation
happens before conversion, so it prevents clipping at the source rather
than warning about it afterward.

Docs — README gains a show-settings guide, a troubleshooting section,
and the API findings from this work.

Why

A live test was run at a concert and clipping was intermittent, the mic got overloaded by bass. Was recorded in Raw mode,
crackling and not recoverable. The meter never warned because it was measuring the wrong thing. This makes overload impossible to miss, and if the hardware allows it, impossible to happen.

The mode-switch button is deliberately idle-only: switching audio modes
restarts the capture session, which would end an in-progress recording.

kiera-dev and others added 3 commits August 5, 2026 11:47
The box was pinned on screen for as long as AE/AF lock was active,
which read as stuck UI rather than as an indicator. Let it fade like
a normal focus box and leave the AE/AF LOCK badge to carry the state.

Also document the exposure lock in the README, which predated it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add a starting-point guide for using the app at a concert, a
troubleshooting section (black preview, stale builds, the benign
FigAudioSession error), and the API findings from building the
exposure lock.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The meter measured RMS, which sits 10-15 dB below peak on dense music —
it read comfortable while a concert recording clipped throughout. Switch
it to true peak with a slow-falling peak hold.

- Count full-scale samples and surface a CLIP badge, reset per take
- Full-screen overload warning plus a warning haptic, since at a show
  you're watching the band rather than the screen
- One-tap "too loud for Raw, switch to Stereo" when clipping while idle
  (not mid-recording: switching modes restarts the session and would
  cost the take)
- Input gain slider in Raw mode, shown only when isInputGainSettable
  reports true — analog attenuation before conversion is the only real
  fix for clipping rather than a warning after the fact

UNTESTED on device: peak math, clip threshold, haptics, and whether the
gain slider appears at all on iPhone built-in mics are all unverified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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