Persist microphone mute and volume settings
This commit is contained in:
committed by
Brandon McGinty
parent
aa38c99aab
commit
4497d41077
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user