Playing wave files

The TeamSpeak Client Lib offers support to play wave files from the local harddisk.

To play a local wave file, call

unsigned int ts3client_playWaveFile(serverConnectionHandlerID,  
 path); 
anyID serverConnectionHandlerID;
const char* path;
 

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

This is the simple version of playing a sound file. It's a fire-and-forget mechanism, this function will not block.


The more complex version is to play an optionally looping sound and obtain a handle, which can be used to pause, unpause and stop the loop.

unsigned int ts3client_playWaveFileHandle(serverConnectionHandlerID,  
 path,  
 loop,  
 waveHandle); 
anyID serverConnectionHandlerID;
const char* path;
int loop;
uint64* waveHandle;
 

Returns ERROR_ok on success, otherwise an error code as defined in public_errors.h. If an error occured, waveHandle is uninitialized and must not be used.


Using the handle obtained by ts3client_playWaveFileHandle, sounds can be paused and unpaused with

unsigned int ts3client_pauseWaveFileHandle(serverConnectionHandlerID,  
 waveHandle,  
 pause); 
anyID serverConnectionHandlerID;
uint64 waveHandle;
int pause;
 

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


Using the handle obtained by ts3client_playWaveFileHandle, sounds can be closed with

unsigned int ts3client_closeWaveFileHandle(serverConnectionHandlerID,  
 waveHandle); 
anyID serverConnectionHandlerID;
uint64 waveHandle;
 

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