From e78a406bcb1a4876b7f91adbcd7e6c5b0a246303 Mon Sep 17 00:00:00 2001 From: bernd Date: Tue, 29 Sep 2026 10:52:16 +0200 Subject: [PATCH] editor.py aktualisiert --- editor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor.py b/editor.py index b7f6be8..adbd3b7 100644 --- a/editor.py +++ b/editor.py @@ -19,6 +19,11 @@ FINISHED_DIR = Path(os.environ.get("FINISHED_DIR", "/finished")) WAVEFORMS_DIR = Path(os.environ.get("WAVEFORMS_DIR", "/waveforms")) WEB_PORT = int(os.environ.get("WEB_PORT", "8080")) +NORMALIZE = os.environ.get("NORMALIZE", "true").lower() not in ("0", "false", "no") +NORMALIZE_TARGET = os.environ.get("NORMALIZE_TARGET", "-16") +NORMALIZE_TRUE_PEAK = os.environ.get("NORMALIZE_TRUE_PEAK", "-1.5") +NORMALIZE_LRA = os.environ.get("NORMALIZE_LRA", "11") + JOBS = {} JOBS_LOCK = threading.Lock() @@ -253,7 +258,7 @@ def create_finished(filename, start, end, progress_callback=None): "-t", f"{selected_duration:.3f}", "-map", "0:a:0", "-vn", "-sn", "-dn", - "-af", "loudnorm=I=-16:TP=-1.5:LRA=11", + *( ["-af", f"loudnorm=I={NORMALIZE_TARGET}:TP={NORMALIZE_TRUE_PEAK}:LRA={NORMALIZE_LRA}"] if NORMALIZE else [] ), "-c:a", "libmp3lame", "-b:a", "128k", "-avoid_negative_ts", "make_zero",