Add F12 hotkey to toggle microphone AGC
Automatic gain control was always on with no way to turn it off. Toggle it with F12, the /agc command, or the agc FIFO command, and persist the choice in the configuration file the same way noise suppression does. AgcEnabled defaults to true so existing setups keep their current behavior, and the saved value is applied to the stream on connect. The enabled flag becomes an atomic.Bool because the capture goroutine reads it while the UI goroutine writes it, and the lazily created right channel AGC now inherits the left channel's state. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
132df6863a
commit
4393739ffa
@@ -90,6 +90,7 @@ func (b *Barnard) connect(reconnect bool) bool {
|
||||
stream.SetMicVolume(b.UserConfig.GetMicVolume(), false)
|
||||
stream.AttachStream(b.Client)
|
||||
stream.SetNoiseProcessor(b.NoiseSuppressor)
|
||||
stream.SetAGCEnabled(b.UserConfig.GetAGCEnabled())
|
||||
stream.SetErrorFunc(func(err error) {
|
||||
if err != nil {
|
||||
b.AddOutputLine(fmt.Sprintf("Microphone: %s", err.Error()))
|
||||
|
||||
Reference in New Issue
Block a user