From cd927b83fb376806e864c6d406bf3892e98ae223 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Sun, 14 Jul 2024 00:13:25 +0300 Subject: [PATCH] bytebeat_compiler.py: extract `BITS_PER_BYTE` --- bytebeat_compiler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index 3823f2d..e7fa949 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -12,6 +12,9 @@ from sys import stdin, stdout, exit from typing import Dict, Union import subprocess +# Definitions +BITS_PER_BYTE = 8 + # Paths PATHS = { "src_dir": "src", @@ -244,7 +247,7 @@ if __name__ == "__main__": "fp_return_type": args.floating_point, "channels": args.channels, "length": samples, - "wav_product": gen_length * (args.bit_depth // 8), + "wav_product": gen_length * (args.bit_depth // BITS_PER_BYTE), "gen_length": gen_length, "sequential_mode": args.mode == "sequential", "block_size": args.block_size,