Make the talking-while-muted beep optional

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 14:25:58 +00:00
parent 03ea2c86c3
commit 4de3ad4cab
3 changed files with 17 additions and 0 deletions

View File

@@ -138,6 +138,8 @@ public final class Settings {
public boolean typingAttenuation = true; public boolean typingAttenuation = true;
/** Automatic gain control: normalise microphone loudness to a target level. */ /** Automatic gain control: normalise microphone loudness to a target level. */
public boolean agc = true; public boolean agc = true;
/** Beep when speech is picked up while the microphone is muted. */
public boolean mutedTalkWarning = true;
// ---- notification sounds ---- // ---- notification sounds ----
/** Directory name of the active sound pack; empty picks the first one found. */ /** Directory name of the active sound pack; empty picks the first one found. */
@@ -258,6 +260,7 @@ public final class Settings {
denoise = parseB(props.getProperty("denoise"), denoise); denoise = parseB(props.getProperty("denoise"), denoise);
denoiserLevel = parseD(props.getProperty("denoiserLevel"), denoiserLevel); denoiserLevel = parseD(props.getProperty("denoiserLevel"), denoiserLevel);
typingAttenuation = parseB(props.getProperty("typingAttenuation"), typingAttenuation); typingAttenuation = parseB(props.getProperty("typingAttenuation"), typingAttenuation);
mutedTalkWarning = parseB(props.getProperty("mutedTalkWarning"), mutedTalkWarning);
agc = parseB(props.getProperty("agc"), agc); agc = parseB(props.getProperty("agc"), agc);
soundPack = props.getProperty("soundPack", soundPack); soundPack = props.getProperty("soundPack", soundPack);
soundVolume = parseD(props.getProperty("soundVolume"), soundVolume); soundVolume = parseD(props.getProperty("soundVolume"), soundVolume);
@@ -307,6 +310,7 @@ public final class Settings {
props.setProperty("denoise", Boolean.toString(denoise)); props.setProperty("denoise", Boolean.toString(denoise));
props.setProperty("denoiserLevel", Double.toString(denoiserLevel)); props.setProperty("denoiserLevel", Double.toString(denoiserLevel));
props.setProperty("typingAttenuation", Boolean.toString(typingAttenuation)); props.setProperty("typingAttenuation", Boolean.toString(typingAttenuation));
props.setProperty("mutedTalkWarning", Boolean.toString(mutedTalkWarning));
props.setProperty("agc", Boolean.toString(agc)); props.setProperty("agc", Boolean.toString(agc));
props.setProperty("soundPack", soundPack); props.setProperty("soundPack", soundPack);
props.setProperty("soundVolume", Double.toString(soundVolume)); props.setProperty("soundVolume", Double.toString(soundVolume));

View File

@@ -543,6 +543,7 @@ public final class TeamspeakConnection implements TS3Listener {
/** Reminds the user, at most every few seconds, that the microphone is muted. */ /** Reminds the user, at most every few seconds, that the microphone is muted. */
private void onTalkingWhileMuted() { private void onTalkingWhileMuted() {
if (!settings.mutedTalkWarning) return;
long now = System.nanoTime(); long now = System.nanoTime();
if (now - lastMutedTalkNanos < MUTED_TALK_COOLDOWN_NANOS) return; if (now - lastMutedTalkNanos < MUTED_TALK_COOLDOWN_NANOS) return;
lastMutedTalkNanos = now; lastMutedTalkNanos = now;

View File

@@ -32,6 +32,7 @@ final class DevicesPanel extends FormPanel {
private final JSlider denoiseLevel; private final JSlider denoiseLevel;
private final JCheckBox typingCheck; private final JCheckBox typingCheck;
private final JCheckBox agcCheck; private final JCheckBox agcCheck;
private final JCheckBox mutedWarningCheck;
DevicesPanel(Settings settings, VoiceOutput livePlayback, DevicesPanel(Settings settings, VoiceOutput livePlayback,
Consumer<Consumer<VoiceInput>> applyLive, Consumer<Consumer<VoiceInput>> applyLive,
@@ -124,6 +125,16 @@ final class DevicesPanel extends FormPanel {
applyLive.accept(m -> m.setDenoiserLevel(denoiseLevel.getValue() / 100.0))); applyLive.accept(m -> m.setDenoiserLevel(denoiseLevel.getValue() / 100.0)));
syncNoise.run(); syncNoise.run();
mutedWarningCheck = new JCheckBox("Beep when talking while muted", settings.mutedTalkWarning);
mutedWarningCheck.setToolTipText("Play a reminder sound when you speak into a muted microphone.");
c.gridx = 0;
c.gridy = row++;
c.gridwidth = 2;
c.insets = UIScale.scale(new Insets(14, 4, 4, 4));
add(mutedWarningCheck, c);
c.insets = UIScale.scale(new Insets(4, 4, 4, 4));
c.gridwidth = 1;
c.gridx = 0; c.gridx = 0;
c.gridy = row; c.gridy = row;
c.weighty = 1; c.weighty = 1;
@@ -140,6 +151,7 @@ final class DevicesPanel extends FormPanel {
target.denoiserLevel = denoiseLevel.getValue() / 100.0; target.denoiserLevel = denoiseLevel.getValue() / 100.0;
target.typingAttenuation = typingCheck.isSelected(); target.typingAttenuation = typingCheck.isSelected();
target.agc = agcCheck.isSelected(); target.agc = agcCheck.isSelected();
target.mutedTalkWarning = mutedWarningCheck.isSelected();
} }
private static void selectOrDefault(JComboBox<AudioDevices.Device> combo, String deviceId) { private static void selectOrDefault(JComboBox<AudioDevices.Device> combo, String deviceId) {