From bb80b13c36ebc6c53c7a0ce1bf7d21b244e8d764 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 10 Dec 2025 11:20:08 -0500 Subject: [PATCH] A minor tweak in volume. --- audio/agc.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/audio/agc.go b/audio/agc.go index 5730dfd..f4ca407 100644 --- a/audio/agc.go +++ b/audio/agc.go @@ -21,7 +21,7 @@ type AGC struct { // NewAGC creates a new AGC processor with sensible defaults for voice func NewAGC() *AGC { return &AGC{ - targetLevel: 0.20, // Target 20% of max amplitude (matches Mumble levels) + targetLevel: 0.18, // Target 18% of max amplitude (balanced level) maxGain: 8.0, // Maximum 8x gain (about 18dB) minGain: 0.1, // Minimum 0.1x gain (-20dB) attackTime: 0.005, // Fast attack (5ms) @@ -106,10 +106,10 @@ func (agc *AGC) ProcessSamples(samples []int16) { } // Soft limiting to prevent clipping - if processed > 0.95 { - processed = 0.95 + (processed-0.95)*0.1 - } else if processed < -0.95 { - processed = -0.95 + (processed+0.95)*0.1 + if processed > 0.90 { + processed = 0.90 + (processed-0.90)*0.1 + } else if processed < -0.90 { + processed = -0.90 + (processed+0.90)*0.1 } // Convert back to int16