Copyright © 2001-2019 MultiMedia Soft

Effects.NormalizationEnable method

Previous pageReturn to chapter overviewNext page

Remarks

 

Enables/disables real-time normalization of songs during playback. For obtaining good results, in order to apply normalization the control will perform detection of the highest peak during the loading phase (started by one of the many methods having the "Load" prefix like LoadSound or LoadSoundFromMemory with the exception of the LoadInternetStream method) so it will need to read the overall sound file: for this reason, when normalization is enabled, it's highly recommended that you avoid loading files stored inside network mapped disks.

 

The loading phase of a sound file that needs to be normalized can be sped up if the value of the highest peak of that specific sound file is already known; the following methods allow calculating the highest peak that could be used for future uses:

- PeakDetectionOnFile

- PeakDetectionOnPlayer

- PeakDetectionOnPlayerRequest

Once the highest peak value is available, it could be applied through the Effects.NormalizationPeakSet method (or through a specific attribute when dealing with items stored inside PDJ playlists) before invoking the LoadSound or LoadSoundFromMemory methods: this will avoid the need to calculate the highest peak value while loading the sound file, allowing a faster loading for sound files, also when stored inside network mapped disks.

 

Normalization doesn't immediately apply to already loaded sound files but takes effect only after the first call to the LoadSound or LoadSoundFromMemory methods.

 

Normalization is not supported in the following cases:

 

Internet streams loaded through the LoadInternetStream method
audio files loaded through the LoadSoundFast method
video clips loaded through DirectShow
on the output of a stream mixer

 

When normalization is enabled on any of the players instanced by the control, eventual custom DSPs must be set to work with floating point samples through the CustomDSP.UseFloatSamples method.

 

See the How to apply special effects to a playing sound section for further details.

 

 

Syntax

 

[Visual Basic]

control.Effects.NormalizationEnable (

nPlayer as Integer,

bEnable as enumBoolean,

fTargetLevelPerc as Single,

fBelowLevelPerc as Single,

fAboveLevelPerc as Single

) as enumErrorCodes


 

[C++]

short control.Effects.NormalizationEnable (

short nPlayer,

short bEnable,

float fTargetLevelPerc,

float fBelowLevelPerc,

float fAboveLevelPerc

);


 

 

 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

bEnable

Boolean value that specifies if normalization must be enabled or disabled.

Supported values are the following:

Mnemonic constant

Value

Meaning

BOOL_FALSE (default)

0

Disables normalization

BOOL_TRUE

1

Enables normalization.

fTargetLevelPerc

Target peak level expressed in percentage.Typical values are 98% (-0.17 dB) or 100% (0 dB).

fBelowLevelPerc

Defines the lower peak level value, expressed in percentage, of the range where normalization effect will not be applied. Set this value to 100 if you want to apply normalization on all peak levels.

fAboveLevelPerc

Defines the higher peak level value, expressed in percentage, of the range where normalization effect will not be applied.  Set this value to 100 if you want to apply normalization on all peak levels.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.ERR_NOERROR (0)

The call was successful.