no-magic-arithmetic
Name nontrivial numeric factors and operational limits.
Why
Unnamed conversion factors, frame sizes and timing limits hide units and can drift across related operations.
Fix
Extract a meaningfully named constant or use validated configuration. Reuse an existing constant when it represents the same unit or limit.
Examples
def normalize(sample): return sample / 32768PCM16_SCALE = 32_768
def normalize(sample): return sample / PCM16_SCALE