compute the sum over the converted buffer

This commit is contained in:
Gilles Boccon-Gibod
2025-02-08 18:09:57 -05:00
committed by Antoine SOULIER
parent 48bbd3eacd
commit f301a22413

View File

@@ -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)