Copyright © 2001-2019 MultiMedia Soft

SilenceDetectionOnPlayer method

Previous pageReturn to chapter overviewNext page

Remarks

 

Performs the calculation of silent portions at the start and end of the sound loaded inside the given player: useful when the automatic silence detection has been disabled through a call to the SilenceDetectionOnPlayerLoadAutoSet method.

 

Differently from the SilenceDetectionOnPlayerRequest method, where silence detection is performed inside a secondary thread, in this case silence detection is performed inside the main thread so, when the method returns, silence positions are immediately available and there is no need to wait for the SilencePositionAvailable event.

 

The possibility to detect sound silence directly on a sound file, without the need to load it inside a player, is given by the SilenceDetectionOnFile method.

 

This method doesn't work with sounds with more than 2 channels (5.1 or 7.1) or if the EnableMixingFeatures property has been set to BOOL_FALSE.

 

For further details about silence detection management see the How to detect silent portions of sound files tutorial.

 

 

Syntax

 

[Visual Basic]

control.SilenceDetectionOnPlayer (

nPlayer as Integer,

nThresholdInitial as Long,

nThresholdFinal as Long,

nInitialPosition as Long,

nFinalPosition as Long

) as enumErrorCodes


 

[C++]

short control.SilenceDetectionOnPlayer (

short nPlayer,

long nThresholdInitial,

long nThresholdFinal,

long *nInitialPosition,

long *nFinalPosition

);


 

 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

nThresholdInitial

Number representing the silence threshold at the start of the loaded sound: can assume values from 0 (no sound) to 32767 (max volume).

nThresholdFinal

Number representing the silence threshold at the end of the loaded sound: can assume values from 0 (no sound) to 32767 (max volume).

nInitialPosition

Reference that, on return from the method call, will contain the detected position, expressed in milliseconds, where audible sound begins

nFinalPosition

Reference that, on return from the method call, will contain the detected position, expressed in milliseconds, where audible sound ends

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.ERR_NOERROR (0)

The method call was successful