Previous Up Next

28.2.15  Normalizing audio

The normalize command scales the amplitude of an audio clip.

Example

To normalize a sinusoidal sound to −6 dB:

t:=soundsec(3):; L,R:=sin(2*pi*440*t),sin(2*pi*445*t):; s:=normalize(createwav([L,R]),-6):;

Indeed, since about computes the level of audio:

about(s)

Bit depth: 16
Channels: 2 (stereo)
Sample rate: 44100
Length: 132300 samples
Duration: 3 seconds
Level: -6.00048 dB


Previous Up Next