|
- package mpx
-
- import (
- "math"
- "testing"
- )
-
- func TestDefaultCombinerCombine(t *testing.T) {
- comb := NewDefaultCombiner()
- value := comb.Combine(1, 0.5, 0.2, -0.1)
- if math.Abs(value-1.6) > 1e-9 {
- t.Fatalf("unexpected combined value: %v", value)
- }
- }
-
- func TestCustomGains(t *testing.T) {
- comb := DefaultCombiner{MonoGain: 0.5, StereoGain: 2, PilotGain: 0, RDSGain: -1}
- result := comb.Combine(1, 1, 1, 1)
- if math.Abs(result-(0.5+2+0-1)) > 1e-9 {
- t.Fatalf("custom gains not applied: %v", result)
- }
- }
|