feat(clients): persist input settings, add mic input gain, fix iOS chat + VoiceOver
Some checks failed
Build Linux Binaries / linux/amd64 (push) Has been cancelled
Build Linux Binaries / linux/arm64 (push) Has been cancelled

Input mode (VAD/PTT/Always-On), VAD threshold, and the new mic gain were
applied to the core + UI but never saved, so every relaunch reset to VAD
defaults. Each client now persists them and re-applies on connect:
  - iOS: UserDefaults (SessionState.loadAndApplyVoiceSettings + setter writes)
  - macOS: UserDefaults via MainWindowController didSet + loadPersistedAudioSettings
    (settings window also restores the VAD slider from the stored threshold)
  - Windows: new Models/VoiceSettings.cs (JSON at %AppData%\VoiceCat\voice.json,
    mirrors FeedbackSettings) loaded/applied in MainForm

Add global send-side mic gain API vc_set_input_gain (applied to MIC PCM in
on_capture_frame before the VAD gate, clamped to int16) + Swift/C# bindings,
and a 0-300% (default 100%) mic-volume slider on all three clients.

Fix iOS chat: ChatView called sendText(scope:.channel) with no targetId (0),
so channel messages went nowhere; now passes session.currentChannelId.

Fix iOS per-user tuning for VoiceOver: the tuning sheet was long-press
.contextMenu only (invisible to VoiceOver); UserRow now also exposes the same
buttons via .accessibilityActions (no visual change).

Verified: core builds clean; ctest 24/27 (3 pre-existing teardown crashes,
reproduced with changes stashed); VoiceCatMac + VoiceCatiOS (arm64 sim) build
SUCCEEDED; VoiceCat.Interop dotnet build succeeded. Windows App not built
(WinForms can't build on macOS) — follows existing patterns.
This commit is contained in:
2026-06-23 03:35:26 +02:00
parent d30c4ee2f5
commit 95f1fb70b0
17 changed files with 354 additions and 6 deletions

View File

@@ -10,6 +10,36 @@ up instantly. Newest status at the top.
## ▶ Where we left off / next action
- **Done (2026-06-23):** **Input-settings persistence, mic input gain, + two iOS bugs (all 3
clients).** Four fixes:
1. **Input settings now persist.** Transmission mode (VAD/PTT/Always-On), VAD threshold, and the
new mic gain were applied to the core + UI but never saved, so every relaunch reset to VAD
defaults. Each client now persists them and re-applies on connect: iOS via `UserDefaults`
(`SessionState.loadAndApplyVoiceSettings` + setter writes, keys `voice.*`); macOS via
`UserDefaults` (`MainWindowController` `didSet` + `loadPersistedAudioSettings`, also restores
the VAD slider from the stored threshold); Windows via new
`VoiceCat.App/Models/VoiceSettings.cs` (JSON at `%AppData%\VoiceCat\voice.json`, mirrors
`FeedbackSettings`) loaded/applied in `MainForm`.
2. **Microphone input gain.** New global send-side API `vc_set_input_gain` (voicecat.h →
`client.cpp::on_capture_frame`, applied to MIC PCM before the VAD gate, clamped to int16) plus
Swift (`setInputGain`) and C# (`SetInputGain`) bindings. Mic-volume slider (0300 %, default
100 %) added to all three clients' input settings, persisted with the rest.
3. **iOS chat send fixed.** `ChatView` called `sendText(scope:.channel)` with no `targetId` (→ 0),
so channel messages went nowhere; now passes `session.currentChannelId`.
4. **iOS per-user tuning reachable via VoiceOver.** The tuning sheet was long-press
`.contextMenu` only (invisible to VoiceOver); `UserRow` now also exposes the same buttons as
`.accessibilityActions` (no visual change), so the actions rotor reaches tuning + admin actions.
- **Verified:** core `cmake --build --preset dev` clean; `ctest --preset dev` = 24/27 (the 3
failures — `external_pcm`, `frame_ms_reframe`, `channel_samplerate` — are a pre-existing
teardown crash on this machine, reproduced identically with the changes stashed). xcframework
rebuilt (`--all`); **VoiceCatMac** and **VoiceCatiOS** (arm64 sim) → BUILD SUCCEEDED;
`VoiceCat.Interop` (`dotnet build`) succeeded. **Windows App not built** (WinForms
net10.0-windows can't build on macOS) — changes follow existing patterns; needs a Windows
build + manual check.
- **Next (manual):** on each client, set PTT + non-default VAD/mic-gain, relaunch → settings
restored; boost a quiet mic and confirm others hear it louder; iOS send a channel message;
iOS VoiceOver → focus a user → actions rotor opens tuning.
- **Done (2026-06-22):** **Fixed growing voice latency (jitter-buffer depth ratchet).** Symptom:
end-to-end latency grew to multiple seconds and "drifted backward," reset only by leaving/
rejoining voice (DTX/FEC/DRED on, 10% loss). Root cause was **not** the codec settings (10% loss