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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user