Copyright © 2008-2019 MultiMedia Soft

TracksPositionsDetect method

Previous pageReturn to chapter overviewNext page

Remarks

 

Detects positions of tracks, containing audible sound, separated by silent partitions inside the loaded sound and store them inside a list.

The list of detected tracks can be enumerated at a later time through the TracksPositionsNumGet and TracksPositionsRangeGet methods. Once detection is completed, the TracksPositionsRangeAttachToNext method could be used in case you should need to attach two tracks and consider them as a single track.

 

Tracks detection can be canceled at any time through the TracksPositionsCancelDetect method.

 

A successful call to this method will fire the TracksPosDetectionStarted event followed by a number of TracksPosDetectionPerc events and finally by the TracksPosDetectionDone event.

 

 

Syntax

 

[Visual Basic]

control.TracksPositionsDetect (

nSilenceThreshold as Integer,

nSilenceMinLength as Long

) as enumErrorCodes


 

[C++]

short control.TracksPositionsDetect (

short nSilenceThreshold,

long nSilenceMinLength

);


 

 

Parameter

Description

 

 

nSilenceThreshold

Number representing the silence threshold referred to the volume level. Supported values are expressed with a linear volume in the range from 0 to 32767. If for example you should set a value of 800, any portion of sound having a volume level lower than 800 would be considered as silent.

In case you should need to set a threshold value expressed in dB, before setting this parameter you could convert the value in dB into a linear value through the following formula (C syntax):

ValueLinear = 32767 * pow (10, ValueInDB/20);

nSilenceMinLength

Number representing the minimal length of silence expressed in milliseconds. If for example you wish to consider as "silent" only those portions of sound whose duration is above one second, you would have to set this value to 1000.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to see the error code meaning

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.