Copyright © 2006-2018 MultiMedia Soft

SoundActivationSystemSet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Enables/disables the Sound Activation System during a recording session.

 

If the recording session is from a sound file, the Sound Activation System is automatically disabled when the recording mode, set through the SetRecordingMode method, is REC_MODE_MIX or REC_MODE_OVERWRITE.

 

For further details see the How the Sound Activation System works tutorial.

 

 

Syntax

 

[Visual Basic]

Public Function SoundActivationSystemSet (

nMode as enumSoundActivationSystemModes,

nSilenceThreshold as Int16,

nSilenceMinLength as Int32,

strLogFile as String

) as enumErrorCodes


 

[C#]

public enumErrorCodes SoundActivationSystemSet (

enumSoundActivationSystemModes nMode,

Int16 nSilenceThreshold,

Int32 nSilenceMinLength,

string strLogFile

);


 

[C++]

public: enumErrorCodes SoundActivationSystemSet (

enumSoundActivationSystemModes nMode,

Int16 nSilenceThreshold,

Int32 nSilenceMinLength,

string strLogFile

);


 

 

Parameter

Description

 

 

nMode

Mode for activating the Sound Activation System.

Supported values are the following:

Mnemonic constant

Value

Meaning

SOUND_ACTIVATION_SYSTEM_DISABLED

0

The Sound Activation System is disabled

SOUND_ACTIVATION_SYSTEM_DISCARD_SILENCE

1

The Sound Activation System is enabled and silence will be discarded

SOUND_ACTIVATION_SYSTEM_KEEP_SILENCE

2

The Sound Activation System is enabled but silence is not discarded: this mode is not supported when recording from sound files through the StartFromFile method.

nSilenceThreshold

Sets the threshold for the Sound Activation System.

Supported values are in the range from 0  (Sound Activation System disabled, same as setting nMode parameter to SOUND_ACTIVATION_SYSTEM_DISABLED) to 32767 (sound recording always enabled).

If for example you should set a value of 800, any incoming sound having a volume level lower than 800 would be considered as silent and would be discarded.

 

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

Sets the minimal length of silence for the Sound Activation System. This property's value is expressed in milliseconds with default value 0.

strLogFile

Sets the absolute pathname for the Sound Activation System log file. This parameter is ignored when recording from sound files through the StartFromFile method.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred. Check the LastError property value in order to see the last error.

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.