Playback options

Sound output can be configured using playback options. Currently the output value can be adjusted.

Playback options can be queried:

unsigned int ts3client_getPlaybackConfigValueAsFloat(serverConnectionHandlerID,  
 ident,  
 result); 
uint64 serverConnectionHandlerID;
const char* ident;
float* result;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h.


To change playback options, call:

unsigned int ts3client_setPlaybackConfigValue(serverConnectionHandlerID,  
 ident,  
 value); 
uint64 serverConnectionHandlerID;
const char* ident;
const char* value;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h.

[Note]Note

Playback options are tied to a playback device, so changing the values only makes sense after a device has been opened.

Example code:

unsigned int error;
float value;

if((error = ts3client_setPlaybackConfigValue(scHandlerID, "volume_modifier", "5.5")) != ERROR_ok) {
    printf("Error setting playback config value: %d\n", error);
    return;
}

if((error = ts3client_getPlaybackConfigValueAsFloat(scHandlerID, "volume_modifier", &value)) != ERROR_ok) {
    printf("Error getting playback config value: %d\n", error);
    return;
}

printf("Volume modifier playback option: %f\n", value);


In addition to changing the global voice volume modifier of all speakers by changing the “volume_modifier” parameter, voice volume of individual clients can be adjusted with:

unsigned int ts3client_setClientVolumeModifier(serverConnectionHandlerID,  
 clientID,  
 value); 
uint64 serverConnectionHandlerID;
anyID clientID;
float value;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h.

When calculating the volume for individual clients, both the global and client volume modifiers will be taken into account.

Client volume modifiers are valid as long as the specified client is visible. Once the client leaves visibility by joining an unsubscribed channel or disconnecting from the server, the client volume modifier will be lost. When the client enters visibility again, the modifier has to be set again by calling this function.

Example:

unsigned int error;
anyID clientID = 123;
float value = 10.0f;

if((error = ts3client_setClientVolumeModifier(scHandlerID, clientID, value)) != ERROR_ok) {
    printf("Error setting client volume modifier: %d\n", error);
	return;
}