Using playback and capture modes and devices

The Client Lib takes care of initializing, using and releasing sound playback and capture devices. Accessing devices is handled by the sound backend shared libraries, found in the soundbackends directory in the SDK. There are different backends available on the supported operating systems: DirectSound and Windows Audio Session API on Windows, Alsa and PulseAudio on Linux, CoreAudio on Mac OS X.

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); 
uint64 serverConnectionHandlerID;
const char* modeID;
const char* playbackDevice;
 

  • serverConnectionHandlerID

    Connection handler of the server on which you want to initialize the playback device.

  • modeID

    The playback mode to use. Valid modes are returned by ts3client_getDefaultPlayBackMode and ts3client_getPlaybackModeList.

    Passing an empty string will use the default playback mode.

  • playbackDevice

    Valid parameters are:

    The string needs to be encoded in UTF-8 format.

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 the sound backend fails to find a usable playback device.


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

    Connection handler of the server on which you want to initialize the capture device.

  • modeID

    The capture mode to use. Valid modes are returned by ts3client_getDefaultCaptureMode and ts3client_getCaptureModeList.

    Passing an empty string will use the default capture mode.

  • captureDevice

    Valid parameters are:

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.