Using playback and capture modes and devices

The Client Lib takes care of initializing, using and releasing sound playback and capture devices. As a cross-platform library, the Client Lib handles all the low-level interfacing for multiple operating systems with Speex, FMOD, DirectSound, CoreAudio, ALSA and OSS.

All strings passed to and from the Client Lib have to be encoded in UTF-8 format.

Initializing modes and devices

To initialize a playback and capture device for a TeamSpeak 3 server connection handler, call

unsigned int ts3client_openPlaybackDevice(serverConnectionHandlerID,  
 modeID,  
 playbackDevice); 
anyID serverConnectionHandlerID;
int modeID;
const char* playbackDevice;
 

Parameters

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. A likely error is ERROR_sound_could_not_open_playback_device if FMOD fails to find a usable playback device.


unsigned int ts3client_openCaptureDevice(serverConnectionHandlerID,  
 modeID,  
 captureDevice); 
anyID serverConnectionHandlerID;
int modeID;
const char* captureDevice;
 

Parameters

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. Likely errors are ERROR_sound_could_not_open_capture_device if the device fails to open or ERROR_sound_handler_has_device if the device is already opened. To avoid this problem, it is recommended to close the capture device before opening it again.