From f301a22413c98d8fc4a69d615563aee7ab0b20e4 Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Sat, 8 Feb 2025 18:09:57 -0500 Subject: [PATCH] compute the sum over the converted buffer --- python/lc3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lc3.py b/python/lc3.py index 5b3bc51..8c4ae71 100644 --- a/python/lc3.py +++ b/python/lc3.py @@ -342,7 +342,7 @@ class Encoder(_Base): pcm_buffer = array.array("f", pcm) # Invert test to catch NaN - if not abs(sum(pcm)) / frame_samples < 2: + if not abs(sum(pcm_buffer)) / frame_samples < 2: raise InvalidArgumentError("Out of range PCM input") padding = max(pcm_len - frame_samples, 0)