A minor tweak in volume.

This commit is contained in:
Storm Dragon
2025-12-10 11:20:08 -05:00
parent 01da54882e
commit bb80b13c36

View File

@@ -21,7 +21,7 @@ type AGC struct {
// NewAGC creates a new AGC processor with sensible defaults for voice // NewAGC creates a new AGC processor with sensible defaults for voice
func NewAGC() *AGC { func NewAGC() *AGC {
return &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) maxGain: 8.0, // Maximum 8x gain (about 18dB)
minGain: 0.1, // Minimum 0.1x gain (-20dB) minGain: 0.1, // Minimum 0.1x gain (-20dB)
attackTime: 0.005, // Fast attack (5ms) attackTime: 0.005, // Fast attack (5ms)
@@ -106,10 +106,10 @@ func (agc *AGC) ProcessSamples(samples []int16) {
} }
// Soft limiting to prevent clipping // Soft limiting to prevent clipping
if processed > 0.95 { if processed > 0.90 {
processed = 0.95 + (processed-0.95)*0.1 processed = 0.90 + (processed-0.90)*0.1
} else if processed < -0.95 { } else if processed < -0.90 {
processed = -0.95 + (processed+0.95)*0.1 processed = -0.90 + (processed+0.90)*0.1
} }
// Convert back to int16 // Convert back to int16