diff --git a/gumble/gumble/integration_audio_test.go b/gumble/gumble/integration_audio_test.go index bc24a55..c17e90c 100644 --- a/gumble/gumble/integration_audio_test.go +++ b/gumble/gumble/integration_audio_test.go @@ -27,13 +27,23 @@ func (l *integrationAudioListener) OnAudioStream(e *gumble.AudioStreamEvent) { // TestLocalMumbleAudioRoundTrip sends generated 440 Hz audio through a real // local Mumble server and requires the other client to decode non-silent PCM. -func TestLocalMumbleAudioRoundTrip(t *testing.T) { testLocalMumbleAudioRoundTrip(t, false) } +func TestLocalMumbleAudioRoundTrip(t *testing.T) { + testLocalMumbleAudioRoundTrip(t, false, gumble.AudioDefaultInterval) +} + +// Regression: non-default permitted intervals must preserve generated audio +// instead of using the old fixed-10ms bitrate calculation. +func TestLocalMumbleAudioTwentyMilliseconds(t *testing.T) { + testLocalMumbleAudioRoundTrip(t, false, 20*time.Millisecond) +} // Regression: TCP tunnel fallback must remain usable when UDP is deliberately // disabled or blocked, rather than silently dropping valid audio. -func TestLocalMumbleTCPAudioFallback(t *testing.T) { testLocalMumbleAudioRoundTrip(t, true) } +func TestLocalMumbleTCPAudioFallback(t *testing.T) { + testLocalMumbleAudioRoundTrip(t, true, gumble.AudioDefaultInterval) +} -func testLocalMumbleAudioRoundTrip(t *testing.T, disableUDP bool) { +func testLocalMumbleAudioRoundTrip(t *testing.T, disableUDP bool, interval time.Duration) { if os.Getenv("BARNARD_MUMBLE_INTEGRATION") != "1" { t.Skip("set BARNARD_MUMBLE_INTEGRATION=1") } @@ -42,6 +52,7 @@ func testLocalMumbleAudioRoundTrip(t *testing.T, disableUDP bool) { c.Address = "localhost:64738" c.Username = name c.DisableUDP = disableUDP + c.AudioInterval = interval return c } tlsConfig := &tls.Config{InsecureSkipVerify: true}