Remarks
Removes any portion of silence found inside the given sound range.
If you should simply need to remove silence at the beginning and at the end of the loaded sound file, you should use the TrimSilence method.
During the execution of the editing session the CallbackEditPerc delegate is invoked in order to notify about the percentage of advancement.
For further details about callback delegates see the How to synchronize the container application with the API tutorial.
Syntax
[Visual Basic]
Public Function RemoveSilence (
nStartPosition as Int32,
nEndPosition as Int32,
nSilenceThreshold as Int16,
nSilenceMinLength as Int32
) as enumErrorCodes
|
|
[C#]
public enumErrorCodes RemoveSilence (
Int32 nStartPosition,
Int32 nEndPosition,
Int16 nSilenceThreshold,
Int32 nSilenceMinLength
);
|
|
[C++]
public: enumErrorCodes RemoveSilence (
Int32 nStartPosition,
Int32 nEndPosition,
Int16 nSilenceThreshold,
Int32 nSilenceMinLength
);
|
|
Parameter
|
Description
|
|
|
nStartPosition
|
Start position, expressed in milliseconds, of the affected sound range.
|
nEndPosition
|
End position, expressed in milliseconds, of the affected sound range.. If set to -1 the end position will be set to the end of the sound.
|
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 (see the LastError property for further error details)
|
enumErrorCodes.ERR_NOERROR (0)
|
The method call was successful.
|
|