Preprocessor options
Sound input is preprocessed by the Client Lib before the data is encoded and sent to the TeamSpeak 3 server. The preprocessor is responsible for noise suppression, automatic gain control (AGC) and voice activity detection (VAD).
The preprocessor can be controlled by setting various preprocessor flags. These flags are stored per server connection and can differ between server connections.
Note
Preprocessor flags are tied to a capture device, so changing the values only makes sense after a device has been opened.
Available config values
The following configuration values are available for querying and setting:
name
The type of the preprocessor in use. Currently always returns “Speex preprocessor”
denoise
Boolean value. Whether or not noise suppression is enabled. Enabled by default.
vad
Boolean value. Whether or not voice activity detection is enabled. Enabled by default.
voiceactivation_level
Integer holding the decibel level above which voice activity detection is sending voice data to the server.
A high voice activation level means you have to speak louder into the microphone in order to start transmitting.
Reasonable values range from -50 to 50. Default is 0.
vad_extrabuffersize
Integer holding the buffer size for voice activity detection.
Valid values are 0 to 8. Defaults to 2. Lower value means faster transmission, higher value means better VAD quality but higher latency.
agc
Boolean value. Whether or not automatic gain control is enabled. Enabled by default.
agc_level
Integer. Automatic gain control level. Defaults to 16000.
agc_main_gain
Integer holding the maximum gain for automatic gain control. Defaults to 30.
echo_canceling
Boolean value. Whether echo cancelling feature is enabled. Defaults to false.
decibel_last_period
Read only Float. Current input levels on the capture device. Queried using
ts3client_getPreProcessorInfoValueFloat()
Querying values
Preprocessor flags can be queried using:
-
unsigned int ts3client_getPreProcessorConfigValue(uint64 serverConnectionHandlerID, const char *ident, char **result)
Retrieve preprocessor configuration values.
Preprocessor settings are bound to a capture device. You must open a capture device on the specified connection handler before calling this function.
- Parameters:
serverConnectionHandlerID – the connection handler for which to retrieve the configuration value
ident – the name of the preprocessor configuration to retrieve
result – address of a variable to receive a c string with the value of the specified preprocessor configuration. Memory is allocated by the client lib and must be freed by caller using ts3client_freeMemory
- Returns:
An Error code from the Ts3ErrorType enum indicating either success or the failure reason
-
unsigned int ts3client_getPreProcessorInfoValueFloat(uint64 serverConnectionHandlerID, const char *ident, float *result)
Retrieve floating point preprocessor configuration values.
- Parameters:
serverConnectionHandlerID – the connection handler for which to retrieve the value
ident – the name of the preprocessor value to retrieve
result – address of a variable to receive the specified configuration value
- Returns:
An Error code from the Ts3ErrorType enum indicating either success or the failure reason
Setting values
To configure the proprocessor use
-
unsigned int ts3client_setPreProcessorConfigValue(uint64 serverConnectionHandlerID, const char *ident, const char *value)
Set preprocessor configuration values.
Preprocessor settings are bound to a capture device. You must open a capture device on the specified connection handler before calling this function.
- Parameters:
serverConnectionHandlerID – the connection handler for which to retrieve the configuration value
ident – the name of the preprocessor configuration to retrieve
value – the new value to set
- Returns:
An Error code from the Ts3ErrorType enum indicating either success or the failure reason
Important
For boolean values use their string representation “true” or “false”
Note
It is not necessary to change all those values. The default values are reasonable. “voiceactivation_level” is often the only value that needs to be adjusted.