From d326f3219305433947263f5c0a4f803c89f2bfbc Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Wed, 10 Jan 2024 04:08:05 +0300 Subject: [PATCH] bytebeat_compiler.py: fix sample rate logic --- bytebeat_compiler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index 57d9097..4e14217 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -176,9 +176,9 @@ if __name__ == "__main__": if no_seconds and samples_exist: samples = args.samples elif seconds_exist and samples_exist: - samples = args.seconds * args.sample_rate + args.samples + samples = args.seconds * args.final_sample_rate + args.samples elif seconds_exist and no_samples: - samples = args.seconds * args.sample_rate + samples = args.seconds * args.final_sample_rate elif no_seconds and no_samples: args.seconds = 30 # default continue @@ -197,7 +197,8 @@ if __name__ == "__main__": rewrite_file(PATHS["substitute"], substitute_vars({ "bytebeat_contents": bytebeat_contents, "output_file": C_str_repr(args.output), - "sample_rate": args.sample_rate, + "sample_rate": \ + value if (value := args.final_sample_rate) else args.sample_rate, "original_sample_rate": original_sample_rate, "final_sample_rate_code": final_sample_rate_code, "bit_depth": args.bit_depth,