From 262e5fb5b4ae6f3a76c5655f6096f0f889705d71 Mon Sep 17 00:00:00 2001 From: David Sutton Date: Fri, 9 Feb 2024 06:28:45 +0000 Subject: [PATCH] Merged in 441-fix-check-samplerate (pull request #532) audio-netsender: Fix sample rate validation * audio-netsender: Fix sample rate validation This change makes a simple change that makes the function compare the requested sample rate against the valid rates instead of the indices of the valid rates. Approved-by: Alan Noble --- cmd/audio-netsender/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/audio-netsender/main.go b/cmd/audio-netsender/main.go index 2be9aaab..945dcdbf 100644 --- a/cmd/audio-netsender/main.go +++ b/cmd/audio-netsender/main.go @@ -282,7 +282,7 @@ func (ac *audioClient) open() error { // to fix this 8000 and 16000 must be removed from this slice. rates := [8]int{8000, 16000, 32000, 44100, 48000, 88200, 96000, 192000} foundRate := false - for r := range rates { + for _, r := range rates { if r < ac.rate { continue }