Normalize audio

From www.ReeltoReel.nl Wiki
Jump to navigation Jump to search

NORMALIZE

# zypper in normalize

SYNOPSIS

normalize [ options ] [ -- ] file ...

First, make a copy of the file. Then do one of the following:

# normalize test.wav

normalizes at -15 dB ???

# normalize -a

Adjust the RMS volume to the target amplitude AMPLITUDE; must be between 0.0 and 1.0. If a number suffixed by "dB" or "dBFS" is specified, the amplitude is assumed to be in decibels from full scale. The default is -12dBFS.

# normalize -b

BATCH MODE

When operating on a group of unrelated files, you usually want all of them at the same level, and this is the default behavior. However, a group of music files all from the same album is generally meant to be listened to at the relative volumes they were recorded at. In batch mode, all the specified files are considered to be part of a single album and their relative volumes are preserved. This is done by averaging the volumes of all the files, computing a single adjustment from that, and applying the same adjustment to all the files. Some analysis is also done so that files with volumes that appear to be statistical aberrations are not considered in the average. This is useful if you have albums (like many of the author's) in which there is one "quiet song" that throws off the average.

# normalize -m, --mix

Enable mix mode: see MIX MODE, below. Batch mode and mix mode are mutually exclusive.

This mode is made especially for making mixed CD's and the like. You want every song on the mix to be the same volume, but it doesn't matter if they are the same volume as the songs on some other mix you made last week. In mix mode, average level of all the files is computed, and each file is separately normalized to this average volume.

# normalize -n 

Compute and output the volume adjustment that would set the volume to the target, but don't apply it to any of the files (i.e. skip the second phase). If you use this option, your files will not be altered in any way.

# normalize --peak

Adjust using peak levels instead of RMS levels. Each file will be adjusted so that its maximum sample is at full scale. This just gives a file the maximum volume possible without clipping; no normalization is done.

# normalize -v

Increase verbosity. This option can be repeated for more messages.

--

end of options

FFMPEG

Detect RMS level

# ffmpeg -i inputfile.flac -filter:A volumedetect -f null /dev/null 
...
[Parsed_volumedetect_0 @ 0x562a0076b200] n_samples: 23664648
[Parsed_volumedetect_0 @ 0x562a0076b200] mean_volume: -12.6 dB
[Parsed_volumedetect_0 @ 0x562a0076b200] max_volume: 0.0 dB
[Parsed_volumedetect_0 @ 0x562a0076b200] histogram_0db: 24907

eventueel:

# for i in *; do ffmpeg -i "$i" -filter:a volumedetect -f null /dev/null 2>&1 | grep mean; done

SOX

# sox inputfile.flac -n stat
# sox inputfile.flac -n stats
            Overall     Left      Right
DC offset   0.000638  0.000397  0.000638 
Min level  -0.773560 -0.773560 -0.773560
Max level   0.773529  0.773529  0.773529
Pk lev dB      -2.23     -2.23     -2.23
RMS lev dB    -14.84    -15.28    -14.43
RMS Pk dB      -8.71    -10.03     -8.71 
RMS Tr dB       -inf      -inf      -inf
Crest factor       -      4.49      4.07
Flat factor     1.74      2.13      1.58
Pk count         131        72       190
Bit-depth      16/16     16/16     16/16
Num samples    11.8M
Length s     268.307
Scale max   1.000000
Window s       0.050