Persist microphone mute and volume settings

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 14:37:06 -04:00
committed by Brandon McGinty
parent aa38c99aab
commit 4497d41077
6 changed files with 28 additions and 6 deletions
+2 -5
View File
@@ -131,6 +131,7 @@ func New(client *gumble.Client, inputDevice *string, outputDevice *string, test
sourceFrameSize: frmsz,
micAGC: audio.NewAGC(), // Always enable AGC for outgoing mic
}
s.micVolume.Store(math.Float32bits(1.0))
if sourceChannels == 2 {
s.micAGCRight = audio.NewAGC()
}
@@ -331,11 +332,7 @@ func (s *Stream) StopSource() error {
}
func (s *Stream) GetMicVolume() float32 {
bits := s.micVolume.Load()
if bits == 0 {
return 1.0 // default on first access
}
return math.Float32frombits(bits)
return math.Float32frombits(s.micVolume.Load())
}
func (s *Stream) SetMicVolume(change float32, relative bool) {