feat(clients): persist input settings, add mic input gain, fix iOS chat + VoiceOver
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:
@@ -51,6 +51,8 @@ partial class MainForm
|
||||
private ProgressBar pbLevel = null!;
|
||||
private Label lblVadThreshold = null!;
|
||||
private TrackBar trkVadThreshold = null!;
|
||||
private Label lblMicGain = null!;
|
||||
private TrackBar trkMicGain = null!;
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
@@ -94,6 +96,8 @@ partial class MainForm
|
||||
pbLevel = new ProgressBar();
|
||||
lblVadThreshold = new Label();
|
||||
trkVadThreshold = new TrackBar();
|
||||
lblMicGain = new Label();
|
||||
trkMicGain = new TrackBar();
|
||||
menuStrip = new MenuStrip();
|
||||
toolStrip = new ToolStrip();
|
||||
tsbJoinVoice = new ToolStripButton();
|
||||
@@ -336,6 +340,23 @@ partial class MainForm
|
||||
trkVadThreshold.TabIndex = 9;
|
||||
trkVadThreshold.Visible = true;
|
||||
|
||||
lblMicGain.Text = "Mic volume:";
|
||||
lblMicGain.AutoSize = true;
|
||||
lblMicGain.Margin = new Padding(12, 5, 4, 0);
|
||||
|
||||
trkMicGain.AccessibleName = "Microphone volume";
|
||||
trkMicGain.AccessibleDescription =
|
||||
"Boost a quiet microphone. 100 is unity; range 0–300 percent.";
|
||||
trkMicGain.Minimum = 0;
|
||||
trkMicGain.Maximum = 300;
|
||||
trkMicGain.Value = 100;
|
||||
trkMicGain.TickFrequency = 25;
|
||||
trkMicGain.SmallChange = 5;
|
||||
trkMicGain.LargeChange = 25;
|
||||
trkMicGain.Width = 120;
|
||||
trkMicGain.Margin = new Padding(0, 2, 0, 0);
|
||||
trkMicGain.TabIndex = 10;
|
||||
|
||||
flpVoiceBottom.Dock = DockStyle.Fill;
|
||||
flpVoiceBottom.Padding = new Padding(4, 0, 4, 2);
|
||||
flpVoiceBottom.Controls.Add(lblInputDevice);
|
||||
@@ -345,6 +366,8 @@ partial class MainForm
|
||||
flpVoiceBottom.Controls.Add(pbLevel);
|
||||
flpVoiceBottom.Controls.Add(lblVadThreshold);
|
||||
flpVoiceBottom.Controls.Add(trkVadThreshold);
|
||||
flpVoiceBottom.Controls.Add(lblMicGain);
|
||||
flpVoiceBottom.Controls.Add(trkMicGain);
|
||||
|
||||
pnlVoice.Dock = DockStyle.Bottom;
|
||||
pnlVoice.Height = 68;
|
||||
|
||||
Reference in New Issue
Block a user