From 676c27fe30f5075fd1dea0779ebaee5f55671a59 Mon Sep 17 00:00:00 2001 From: "Brandon McGinty (deepseek)" Date: Sat, 8 Aug 2026 19:59:03 -0400 Subject: [PATCH] fix: reset stereo encoder state when disabling stereo mode DisableStereoEncoder now resets the stereo encoder so stale encoder state from one file playback session does not bleed into the next. Without this, the Opus encoder's internal state machine could produce a glitch at the start of the next file playback. --- gumble/gumble/client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gumble/gumble/client.go b/gumble/gumble/client.go index e77395b..ad9d0e2 100644 --- a/gumble/gumble/client.go +++ b/gumble/gumble/client.go @@ -297,11 +297,16 @@ func (c *Client) EnableStereoEncoder() { c.useStereoEncoder = true } -// DisableStereoEncoder switches back to mono encoding for voice. +// DisableStereoEncoder switches back to mono encoding for voice and +// resets the stereo encoder so stale state does not bleed into the +// next file playback. func (c *Client) DisableStereoEncoder() { c.volatile.Lock() defer c.volatile.Unlock() c.useStereoEncoder = false + if c.AudioEncoderStereo != nil { + c.AudioEncoderStereo.Reset() + } } // IsStereoEncoderEnabled returns true if stereo encoding is currently active.