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:
@@ -10,6 +10,7 @@ import com.ts3client.sound.SoundNotifier;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.JTabbedPane;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
@@ -83,11 +84,17 @@ public final class SettingsDialog extends JDialog {
|
||||
getContentPane().add(tabs, BorderLayout.CENTER);
|
||||
getContentPane().add(buttons, BorderLayout.SOUTH);
|
||||
|
||||
// The microphone test hears typing too, so typing attenuation can be tried out here.
|
||||
Runnable testKeyPress = () -> SwingUtilities.invokeLater(
|
||||
() -> voiceActivationPanel.configureTest(VoiceInput::keyPressed));
|
||||
hotkeys.addKeyPressListener(testKeyPress);
|
||||
|
||||
Dialogs.closeOnEscape(this, this::cancel);
|
||||
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||
addWindowListener(new java.awt.event.WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosed(java.awt.event.WindowEvent e) {
|
||||
hotkeys.removeKeyPressListener(testKeyPress);
|
||||
voiceActivationPanel.stopTest();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user