3D Sound

TeamSpeak 3 supports 3D sound to assign each speaker a unique position in 3D space. Provided are wrapper functions to the FMOD 3D sound system to modify the 3D position, velocity and orientation of own and foreign clients.

Generally the struct TS3CLIENT_FMOD_VECTOR describes a vector in 3D space:

typedef struct {
    float x;        /* X coordinate in 3D space. */
    float y;        /* Y coordinate in 3D space. */
    float z;        /* Z coordinate in 3D space. */
} TS3CLIENT_FMOD_VECTOR;

To set the position, velocity and orientation of the own client in 3D space, call:

unsigned int ts3client_fmod_Systemset3DListenerAttributes(serverConnectionHandlerID,  
 position,  
 velocity,  
 forward,  
 up); 
anyID serverConnectionHandlerID;
const TS3_FMOD_VECTOR* position;
const TS3_FMOD_VECTOR* velocity;
const TS3_FMOD_VECTOR* forward;
const TS3_FMOD_VECTOR* up;
 

Parameters

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

This function is a wrapper for the FMOD function System::set3DListenerAttributes. Please see the FMOD documentation for details.


To adjust FMOD 3D sound system settings use:

unsigned int ts3client_fmod_Systemset3DSettings(serverConnectionHandlerID,  
 dopplerScale,  
 distanceFactor,  
 rolloffScale); 
anyID serverConnectionHandlerID;
float dopplerScale;
float distanceFactor;
float rolloffScale;
 

Parameters

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

This function is a wrapper for the FMOD function System::set3DSettings. Please see the FMOD documentation for details.


To adjust a clients position and velocity in 3D space, call:

unsigned int ts3client_fmod_Channelset3DAttributes(serverConnectionHandlerID,  
 clientID,  
 position,  
 velocity); 
anyID serverConnectionHandlerID;
anyID clientID;
const TS3_FMOD_VECTOR* position;
const TS3_FMOD_VECTOR* velocity;
 

Parameters

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

This function is a wrapper to the FMOD function Channel::set3DAttributes. See the FMOD documentation for details.