Skip to content

Commit

Permalink
tweak norm settings
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowsink committed Nov 17, 2024
1 parent 53d432d commit b9a7054
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions UwuRadio.Server/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static Constants
public double AudioNormIntegrated { get; set; }

/// <summary>
/// Allow to clip the audio by at most this much dB True Peak
/// Target loudness range
/// </summary>
public double AudioNormMaxClip { get; set; }
public double AudioNormLra { get; set; }
}
4 changes: 2 additions & 2 deletions UwuRadio.Server/DSP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static async Task<Loudnorm> MeasureLoudness(string path)
"-i",
path,
"-af",
$"loudnorm=I={Constants.C.AudioNormIntegrated}:TP={Constants.C.AudioNormMaxClip}:print_format=json",
$"loudnorm=I={Constants.C.AudioNormIntegrated}:TP=0:LRA={Constants.C.AudioNormLra}:print_format=json",
"-f",
"null",
"-"
Expand All @@ -73,7 +73,7 @@ public static async Task Normalize(string inPath, string outPath, Loudnorm measu
"-i",
inPath,
"-af",
$"loudnorm=I={Constants.C.AudioNormIntegrated}:TP={Constants.C.AudioNormMaxClip}"
$"loudnorm=I={Constants.C.AudioNormIntegrated}:TP=0:LRA={Constants.C.AudioNormLra}"
+ $":measured_I={measurement.I}:measured_TP={measurement.TP}"
+ $":measured_LRA={measurement.LRA}:measured_thresh={measurement.Thresh}"
+ $":offset={measurement.Oset}:linear=true",
Expand Down
4 changes: 2 additions & 2 deletions UwuRadio.Server/constants.debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"IngestFolder": "../ingest",
"AudioFormat": "mp3",
"AudioQScale": "6",
"AudioNormIntegrated": -9,
"AudioNormMaxClip": 0
"AudioNormIntegrated": -10,
"AudioNormLra": 11
}
4 changes: 2 additions & 2 deletions UwuRadio.Server/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"IngestFolder": "ingest",
"AudioFormat": "mp3",
"AudioQScale": "4",
"AudioNormIntegrated": -9,
"AudioNormMaxClip": 0
"AudioNormIntegrated": -10,
"AudioNormLra": 11
}

0 comments on commit b9a7054

Please sign in to comment.