diff --git a/gumble/opus/opus.go b/gumble/opus/opus.go index 23e8eee..39eb8c4 100644 --- a/gumble/opus/opus.go +++ b/gumble/opus/opus.go @@ -68,6 +68,9 @@ func (e *Encoder) Encode(pcm []int16, _, maxDataBytes int) ([]byte, error) { // Opus encodes best when the bitrate target is set properly rather than // relying on truncation, which can produce incomplete or corrupt frames. bitrate := maxDataBytes * 8 * 100 + if bitrate < 8000 { + bitrate = 8000 // Opus minimum viable bitrate for voice + } _ = e.Encoder.SetBitrate(bitrate) buf := make([]byte, maxDataBytes)