Copyright © 2001-2018 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 a network disk.

 

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.