Process the microphone like TS3, and tell it about key presses

The capture path now runs the ported WebRTC chain in place of the
home-made noise, typing and gain stages, which are removed.

- As in TS3, the speech detector judges the raw microphone signal, while
  the level meter and volume gate see the processed one.
- Noise removal takes TS3's four levels (6, 12, 18 or 21 dB); a stored
  0..1 level falls back to TS3's default of 12 dB.
- Every key press from the global input hook reaches the connected
  microphones and the microphone test, so typing attenuation engages
  while the user types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 20:47:04 +00:00
parent de5f7da236
commit 1d61f458ae
12 changed files with 102 additions and 588 deletions

View File

@@ -95,6 +95,7 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
this.soundPlayer = audio.createSoundPlayer(settings);
this.sounds.setPlayer(soundPlayer);
this.hotkeys = new HotkeyService(new HotkeyActions(this), this::hotkeyArgumentChoices);
hotkeys.addKeyPressListener(() -> SwingUtilities.invokeLater(this::keyPressed));
contacts.addListener(() -> SwingUtilities.invokeLater(this::contactsChanged));
setIconImages(Icons.appImages());
@@ -482,6 +483,15 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
tab.connection().getMicrophone().setPushToTalk(talking);
}
/** Tells every connected microphone about a key press, as TS3 tells all its connections. */
private void keyPressed() {
for (ServerTab tab : tabs) {
if (tab.isConnected() && tab.connection().getMicrophone() != null) {
tab.connection().getMicrophone().keyPressed();
}
}
}
void moveMicrophoneToSelectedTab() {
if (selected != null && selected.isConnected()) setMicTab(selected);
updateToolbar();