Initializing devices
Before a device can be used for playback or capture, you have to initialize and open the device.
Note
Only one device can be active simultaneously per type.
You cannot have more than one playback device or more than one capture device open at any given time. You can have up to one playback and up to one capture device open simultaneously.
Likely errors are ERROR_sound_could_not_open_capture_device
if the device fails to open or ERROR_sound_handler_has_device
if there is already an open device on the connection.
Note
If you want to switch devices on a connection, close the current device first, then open the new one.
Playback
To initialize a playback device on a connection call
-
unsigned int ts3client_openPlaybackDevice(uint64 serverConnectionHandlerID, const char *modeID, const char *playbackDevice)
initializes a playback device for a connection handler
Call this function to start audio playback of TeamSpeak audio on a connection
- Parameters:
serverConnectionHandlerID – the connection handler on which to initialize the specified device
modeID – utf8 encoded c-string containing the mode to open the device in. Pass an empty string to use the default mode. See ts3client_getPlaybackModeList and ts3client_getDefaultPlayBackMode for a list of valid modes.
playbackDevice – utf8 encoded c-string containing the device name of the device to open. Pass an empty string to use the default device. See ts3client_getPlaybackDeviceList and ts3client_getDefaultPlaybackDevice for valid devices.
- Returns:
An Error code from the Ts3ErrorType enum indicating either success or the failure reason
Capture
To initialize a capture device on a connection call
-
unsigned int ts3client_openCaptureDevice(uint64 serverConnectionHandlerID, const char *modeID, const char *captureDevice)
initializes a capture device for a connection handler
Call this function to start consuming audio from the specified device and send it to the server
- Parameters:
serverConnectionHandlerID – the connection handler on which to open the capture device
modeID – utf8 encoded c-string containing the mode in which to open the device. Pass an empty string to use the default mode. See ts3client_getCaptureModeList and ts3client_getDefaultCaptureMode for a list of valid modes.
captureDevice – utf8 encoded c-string containing the device name of the device to open. Pass an empty string to use the default device. See ts3client_getCaptureDeviceList and ts3client_getDefaultCaptureDevice for a list or valid devices.
- Returns:
An Error code from the Ts3ErrorType enum indicating either success or the failure reason