Updated to "sox_ng" and changed the audio normalization to "loudnorm -18 LUFS "

This commit is contained in:
2025-09-21 20:47:18 +02:00
parent da56bc3a81
commit 8577bfcac8
4 changed files with 738 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ def convert_audio_track(stream_index, channels, temp_dir, source_file, should_do
# Step 2: Normalize the track with SoX
print(" - Normalizing with SoX...")
run_cmd(["sox", str(temp_extracted), str(temp_normalized), "-S", "--temp", str(temp_dir), "--guard", "gain", "-n"])
run_cmd(["sox", str(temp_extracted), str(temp_normalized), "--temp", str(temp_dir), "loudness", "-18"])
# Step 3: Encode to Opus with the correct bitrate
bitrate = "192k" # Fallback