Apply voice settings to a live microphone in one place

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 14:10:35 +00:00
parent d206b12a30
commit 35d6427456
2 changed files with 16 additions and 14 deletions

View File

@@ -77,4 +77,19 @@ public interface VoiceInput extends Microphone {
/** Called when speech is detected while the microphone is muted. */
void setMutedTalkListener(Runnable listener);
/** Takes on the voice settings, as they stand now, while capturing. */
default void apply(Settings settings) {
setMode(settings.inputMode);
setVadMode(settings.vadMode);
setThresholdDb(settings.vadThresholdDb);
setSpeechThreshold(settings.speechThreshold);
setVadOverPtt(settings.vadOverPtt);
setInputGain(settings.inputVolume);
setNoiseSuppression(settings.denoise);
setDenoiserLevel(settings.denoiserLevel);
setTypingAttenuation(settings.typingAttenuation);
setAgc(settings.agc);
setOpusParameters(OpusParameters.from(settings));
}
}