levelFileProcess
Corrects a file to the properties provided. Takes an audio file (wav/aiff/flac) and adjusts it to target and limiter settings
Syntax
levelFileProcess(infile, outfile, props)
Returns
an object with loudness info and input properties
Parameters
- infile (string)
- path to uncompressed audio file (wav/aiff/flac)
- outfile (string)
- path to non-existant output file path. In existing folder.
- props (object)
- with these properties
Usage
props (object) with these properties
- AdjustLevel_NoLimit (float) the gain change in dB
- NeedLimiting (bool) enable the limiter
- LimitThresholddB (float) peak limiter threshold in dB
This function adjusts audio files (wav, aiff and flac) to a target level (loudness or peak). This is often used together with the levelFileAnalyse
function.
/* Input file */
var infile = "/Users/Wouter/Documents/infile.aiff";
/* Output file */
var outfile = "/Users/Wouter/Documents/outfile.aiff";
/* Properties */
var properties = {
"AdjustLevel_NoLimit" : 0.,
"NeedLimiting" : true,
"LimitThresholddB" : -1.,
};
/* Execute the function */
var rtn = levelFileProcess(infile, outfile, properties);
/* Print the results of the funtion in the log */
echo(objectToString(rtn));
callback
To keep track of the progress, add a LevelFileProcess_Progress(file, progress) function. It is called when levelFileProcess() 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.