levelFileAnalyse

Takes an audio file (wav/aiff/flac) and analyses it

Syntax

levelFileAnalyse(infile, props)

Returns

an object with loudness info and input properties

Parameters

infile (string)
path to input file in wav/aiff/flac format.
props (object)
an object with the loudness settings to be used

Usage

props (object) properties to configure the analysis

- AdjustTargetType (string):  ( either "LU", "LUFS", "LUFS_UNGATED", "LU_Dialog",  "LU_Dialog_UNGATED", "LUFS_Dialog", "LUFS_Dialog_UNGATED", "PPM", 
"RMS", "Peak", "TruePeakLP", "TruePeakHP", "AutoPeak" )
- AdjustTargetLevel (float) calibrated desired level
- RelativeGate (float) level 0 is off.
- DialogGate (bool) needed for ATSC compliance
- CalibrationLU (float) loudness calibration level (ie. -23.0)
- ChannelWeightCh1 (float) default 1.
- ChannelWeightCh2 (float) default 1.;
- ChannelWeightCh3 (float) default 1.;
- ChannelWeightCh4 (float) default 0.737;
- ChannelWeightCh5 (float) default 0.737;
- ChannelWeightCh6 (float) default 0.;
- CalibrationPPM (float) default -9.;
- CalibrationPeak (float) default 0.;
- SurroundOrder (string): ( either "SMTPE_ITU_AC3", "FilmDolbyDigital" or "DTS_ProControl" )

returns (object) an updated version of the input props containing the results:

AdjustLevel_NoLimit (float)
NeedLimiting (bool)
LimitThresholddB (float)
AdjustLevel (float)
AdjustLevelLowered (bool)
LU (float)
LUFS (float)
LUFS_UNGATED (float)
LU_Dialog (float)
LU_Dialog_UNGATED (float)
LUFS_Dialog (float)
LUFS_Dialog_UNGATED (float)
Dialog_percentage (float)
Max_M (float)
Max_S (float)
Max_M_FS (float)
Max_S_FS (float)
LRA (float)
LRA_Low (float)
LRA_High (float)
LRA_Min (float)
LRA_Max (float)
Peak (float)
TruePeak (float)
PPM_Max (float)
PSR_Min (float)
RMS_Max (float) depreciated
PeakLoudness (float)

Which should look like this

{
  "AdjustTargetType": "LU",
  "AdjustTargetLevel": 0.0,
  "ChannelWeightCh1": 1.0,
  "ChannelWeightCh2": 1.0,
  "ChannelWeightCh3": 0.0,
  "ChannelWeightCh4": 0.0,
  "ChannelWeightCh5": 0.0,
  "ChannelWeightCh6": 0.0,
  "RelativeGate": -10.0,
  "DialogGate": false,
  "CalibrationLU": -23.0,
  "CalibrationPPM": -9.0,
  "CalibrationPeak": 0.0,
  "SurroundOrder": "SMTPE_ITU_AC3",
  "AdjustLevel_NoLimit": -6.183565139770508,
  "NeedLimiting": false,
  "LimitThresholddB": -1.0,
  "AdjustLevel": -6.183565139770508,
  "AdjustLevelLowered": false,
  "LU": 6.183565139770508,
  "LUFS": -16.81643486022949,
  "LUFS_UNGATED": -16.88039207458496,
  "LU_Dialog": 6.183565139770508,
  "LU_Dialog_UNGATED": 6.119607925415039,
  "LUFS_Dialog": -16.81643486022949,
  "LUFS_Dialog_UNGATED": -16.88039207458496,
  "Dialog_percentage": 100.0,
  "Max_M": 8.815200805664062,
  "Max_S": 7.381097793579102,
  "Max_M_FS": -14.18479919433594,
  "Max_S_FS": -15.6189022064209,
  "LRA": 1.959999084472656,
  "LRA_Low": -17.76000213623047,
  "LRA_High": -15.80000305175781,
  "LRA_Min": -1.100000381469727,
  "LRA_Max": 8.55999755859375,
  "Peak": -9.049786567687988,
  "TruePeak": -9.049786567687988,
  "PPM_Max": -1.072465896606445,
  "PSR_Min": 0.0,
  "RMS_Max": null,
  "PeakLoudness": 7.766648292541504
}

callback

To keep track of the progress, add a LevelFileAnalyse_Progresss(file, progress) function. It is called when levelFileAnalyse() is busy. The callback contains 2 arguments, the file path as string. And the progress as float from 0. to 1. which can be used in combination with setProgress() to keep the user informed.