Test 20ms local Mumble audio interval
This commit is contained in:
committed by
Brandon McGinty
parent
5cd23f5df8
commit
ee8a3a6d63
@@ -27,13 +27,23 @@ func (l *integrationAudioListener) OnAudioStream(e *gumble.AudioStreamEvent) {
|
|||||||
|
|
||||||
// TestLocalMumbleAudioRoundTrip sends generated 440 Hz audio through a real
|
// TestLocalMumbleAudioRoundTrip sends generated 440 Hz audio through a real
|
||||||
// local Mumble server and requires the other client to decode non-silent PCM.
|
// 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
|
// Regression: TCP tunnel fallback must remain usable when UDP is deliberately
|
||||||
// disabled or blocked, rather than silently dropping valid audio.
|
// 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" {
|
if os.Getenv("BARNARD_MUMBLE_INTEGRATION") != "1" {
|
||||||
t.Skip("set 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.Address = "localhost:64738"
|
||||||
c.Username = name
|
c.Username = name
|
||||||
c.DisableUDP = disableUDP
|
c.DisableUDP = disableUDP
|
||||||
|
c.AudioInterval = interval
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
tlsConfig := &tls.Config{InsecureSkipVerify: true}
|
tlsConfig := &tls.Config{InsecureSkipVerify: true}
|
||||||
|
|||||||
Reference in New Issue
Block a user