Sound Capture and Playback

This section explains how to record and playback audio in the client instance. More...

Classes

struct  SoundDevice
 A struct containing the properties of a sound device for either playback or recording. More...
struct  AudioBlock
 An audio block containing the raw audio from a user who was talking. More...

Typedefs

typedef enum SoundSystem SoundSystem
 The supported sound systems.
typedef struct SoundDevice SoundDevice
 A struct containing the properties of a sound device for either playback or recording.
typedef enum SoundLevel SoundLevel
 An enum encapsulation the minimum, maximum and default sound levels for input and output sound devices.
typedef enum AudioFileStatus AudioFileStatus
 Status of audio files being written to disk.
typedef enum AudioFileFormat AudioFileFormat
 Audio file formats supported for muxed audio recordings.
typedef struct AudioBlock AudioBlock
 An audio block containing the raw audio from a user who was talking.

Enumerations

enum  SoundSystem { SOUNDSYSTEM_WINMM = 1, SOUNDSYSTEM_DSOUND = 2, SOUNDSYSTEM_ALSA = 3, SOUNDSYSTEM_COREAUDIO = 4 }
 

The supported sound systems.

More...
enum  SoundLevel {
  SOUND_VU_MAX = 20, SOUND_VU_MIN = 0, SOUND_VOLUME_MAX = 255, SOUND_VOLUME_MIN = 0,
  SOUND_GAIN_MAX = 32000, SOUND_GAIN_DEFAULT = 1000, SOUND_GAIN_MIN = 0
}
 

An enum encapsulation the minimum, maximum and default sound levels for input and output sound devices.

More...
enum  AudioFileStatus { AFS_ERROR = 0, AFS_STARTED = 1, AFS_FINISHED = 2, AFS_ABORTED = 3 }
 

Status of audio files being written to disk.

More...
enum  AudioFileFormat {
  AFF_NONE = 0, AFF_WAVE_FORMAT = 2, AFF_MP3_64KBIT_FORMAT = 3, AFF_MP3_128KBIT_FORMAT = 4,
  AFF_MP3_256KBIT_FORMAT = 5, AFF_MP3_16KBIT_FORMAT = 6, AFF_MP3_32KBIT_FORMAT = 7
}
 

Audio file formats supported for muxed audio recordings.

More...

Functions

TEAMTALKDLL_API BOOL TT_GetDefaultSoundDevices (IN TTInstance *lpTTInstance, OUT INT32 *lpnInputDeviceID, OUT INT32 *lpnOutputDeviceID)
 Get the default sound devices.
TEAMTALKDLL_API BOOL TT_GetSoundInputDevices (IN TTInstance *lpTTInstance, IN OUT SoundDevice *lpSoundDevices, IN OUT INT32 *lpnHowMany)
 Get information about input devices for audio recording.
TEAMTALKDLL_API BOOL TT_GetSoundOutputDevices (IN TTInstance *lpTTInstance, IN OUT SoundDevice *lpSoundDevices, IN OUT INT32 *lpnHowMany)
 Get the list of sound output devices for playback.
TEAMTALKDLL_API BOOL TT_InitSoundInputDevice (IN TTInstance *lpTTInstance, IN INT32 nInputDeviceID)
 Initialize the sound input devices (for recording audio).
TEAMTALKDLL_API BOOL TT_InitSoundOutputDevice (IN TTInstance *lpTTInstance, IN INT32 nOutputDeviceID)
 Initialize the sound output devices (for sound playback).
TEAMTALKDLL_API BOOL TT_InitSoundDuplexDevices (IN TTInstance *lpTTInstance, IN INT32 nInputDeviceID, IN INT32 nOutputDeviceID)
 Enable duplex mode where multiple audio streams are mixed into a single stream using software.
TEAMTALKDLL_API BOOL TT_CloseSoundInputDevice (IN TTInstance *lpTTInstance)
 Shutdown the input sound device.
TEAMTALKDLL_API BOOL TT_CloseSoundOutputDevice (IN TTInstance *lpTTInstance)
 Shutdown the output sound device.
TEAMTALKDLL_API BOOL TT_CloseSoundDuplexDevices (IN TTInstance *lpTTInstance)
 Shut down sound devices running in duplex mode.
TEAMTALKDLL_API BOOL TT_StartSoundLoopbackTest (IN TTInstance *lpTTInstance, IN INT32 nInputDeviceID, IN INT32 nOutputDeviceID, IN INT32 nSampleRate, IN INT32 nChannels)
 Perform a record and playback test of specified sound devices.
TEAMTALKDLL_API BOOL TT_StartSoundLoopbackTestEx (IN TTInstance *lpTTInstance, IN INT32 nInputDeviceID, IN INT32 nOutputDeviceID, IN INT32 nSampleRate, IN INT32 nChannels, IN const AudioConfig *lpAudioConfig, IN BOOL bEchoCancel)
 Perform a record and playback test of specified sound devices along with an audio configuration and ability to try echo cancellation.
TEAMTALKDLL_API BOOL TT_StopSoundLoopbackTest (IN TTInstance *lpTTInstance)
 Stop recorder and playback test.
TEAMTALKDLL_API INT32 TT_GetSoundInputLevel (IN TTInstance *lpTTInstance)
 Get the volume level of the current recorded audio.
TEAMTALKDLL_API BOOL TT_SetSoundInputGainLevel (IN TTInstance *lpTTInstance, IN INT32 nLevel)
 Set voice gaining of recorded audio.
TEAMTALKDLL_API INT32 TT_GetSoundInputGainLevel (IN TTInstance *lpTTInstance)
 Get voice gain level of outgoing audio.
TEAMTALKDLL_API BOOL TT_SetSoundOutputVolume (IN TTInstance *lpTTInstance, IN INT32 nVolume)
 Set master volume.
TEAMTALKDLL_API INT32 TT_GetSoundOutputVolume (IN TTInstance *lpTTInstance)
 Get master volume.
TEAMTALKDLL_API BOOL TT_SetSoundOutputMute (IN TTInstance *lpTTInstance, IN BOOL bMuteAll)
 Set all users mute.
TEAMTALKDLL_API BOOL TT_EnableDenoising (IN TTInstance *lpTTInstance, IN BOOL bEnable)
 Enable denoising of recorded audio.
TEAMTALKDLL_API BOOL TT_SetDenoiseLevel (IN TTInstance *lpTTInstance, IN INT32 nLevel)
 Set the denoise level of recorded audio.
TEAMTALKDLL_API INT32 TT_GetDenoiseLevel (IN TTInstance *lpTTInstance)
 Set the denoise level of recorded audio.
TEAMTALKDLL_API BOOL TT_EnableEchoCancellation (IN TTInstance *lpTTInstance, IN BOOL bEnable)
 Enable/disable acoustic echo cancellation (AEC).
TEAMTALKDLL_API BOOL TT_EnableAGC (IN TTInstance *lpTTInstance, IN BOOL bEnable)
 Enable Automatic Gain Control.
TEAMTALKDLL_API BOOL TT_SetAGCSettings (IN TTInstance *lpTTInstance, IN INT32 nGainLevel, IN INT32 nMaxIncrement, IN INT32 nMaxDecrement, IN INT32 nMaxGain)
 Set Automatic Gain Control (AGC) settings.
TEAMTALKDLL_API BOOL TT_GetAGCSettings (IN TTInstance *lpTTInstance, OUT INT32 *lpnGainLevel, OUT INT32 *lpnMaxIncrement, OUT INT32 *lpnMaxDecrement, OUT INT32 *lpnMaxGain)
 Get Automatic Gain Control settings.
TEAMTALKDLL_API BOOL TT_Enable3DSoundPositioning (IN TTInstance *lpTTInstance, IN BOOL bEnable)
 Enable automatically position users using 3D-sound.
TEAMTALKDLL_API BOOL TT_AutoPositionUsers (IN TTInstance *lpTTInstance)
 Automatically position users using 3D-sound.
TEAMTALKDLL_API BOOL TT_EnableAudioBlockEvent (IN TTInstance *lpTTInstance, IN BOOL bEnable)
 Enable/disable access to user's raw audio.
TEAMTALKDLL_API BOOL TT_SetUserVolume (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nVolume)
 Set the volume of a user.
TEAMTALKDLL_API INT32 TT_GetUserVolume (IN TTInstance *lpTTInstance, IN INT32 nUserID)
 Get the volume of a user.
TEAMTALKDLL_API BOOL TT_SetUserGainLevel (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nGainLevel)
 Use software to gain a user's volume.
TEAMTALKDLL_API INT32 TT_GetUserGainLevel (IN TTInstance *lpTTInstance, IN INT32 nUserID)
 Get the software gain level for a user.
TEAMTALKDLL_API BOOL TT_SetUserMute (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN BOOL bMute)
 Mute a user.
TEAMTALKDLL_API BOOL TT_SetUserStoppedTalkingDelay (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN INT32 nDelayMSec)
 Set the delay of when a user should be considered to no longer be talking.
TEAMTALKDLL_API INT32 TT_GetUserStoppedTalkingDelay (IN TTInstance *lpTTInstance, IN INT32 nUserID)
 Get the delay of when a user should no longer be considered as talking.
TEAMTALKDLL_API BOOL TT_SetUserPosition (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN float x, IN float y, IN float z)
 Set the position of a user.
TEAMTALKDLL_API BOOL TT_GetUserPosition (IN TTInstance *lpTTInstance, IN INT32 nUserID, OUT float *x, OUT float *y, OUT float *z)
 Get a user's position.
TEAMTALKDLL_API BOOL TT_SetUserStereo (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN BOOL bLeftSpeaker, IN BOOL bRightSpeaker)
 Set whether a user should speak in the left, right or both speakers. This function only works if AudioCodec has been set to use stereo.
TEAMTALKDLL_API BOOL TT_GetUserStereo (IN TTInstance *lpTTInstance, IN INT32 nUserID, OUT BOOL *lpbLeftSpeaker, OUT BOOL *lpbRightSpeaker)
 Check what speaker a user is outputting to.
TEAMTALKDLL_API BOOL TT_SetUserAudioFolder (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN const TTCHAR *szFolderPath, IN const TTCHAR *szFileNameVars, IN AudioFileFormat uAFF)
 Store user's audio to disk.
TEAMTALKDLL_API BOOL TT_AcquireUserAudioBlock (IN TTInstance *lpTTInstance, IN INT32 nUserID, OUT AudioBlock *lpAudioBlock)
 Extract the raw audio from a user who has been talking.
TEAMTALKDLL_API BOOL TT_ReleaseUserAudioBlock (IN TTInstance *lpTTInstance, IN INT32 nUserID)
 Release the shared memory of an AudioBlock.
TEAMTALKDLL_API BOOL TT_ReleaseAllAudioBlocks (IN TTInstance *lpTTInstance)
 Release all audio blocks of the local client instance.

Detailed Description

This section explains how to record and playback audio in the client instance.

Before being able to initialize the sound devices to use for recording and playback the computer's available sound devices must first be queried. This is done using the functions TT_GetSoundInputDevices and TT_GetSoundOutputDevices. These two functions return arrays of SoundDevice-structs which contains a description of the sound device. In the SoundDevice-struct there's a member variable called nDeviceID. This ID should be passed to the client instance's two sound initialization functions TT_InitSoundInputDevice and TT_InitSoundOutputDevice. Once this has been done the TT_GetFlags call will return a value containing the mask bits CLIENT_SNDINPUT_READY and CLIENT_SNDOUTPUT_READY.

A computer's default sound devices can be queried using TT_GetDefaultSoundDevices. A loop-back test of the selected sound devices can be performed using TT_StartSoundLoopbackTest.

Be aware that the sound devices might fail if e.g. a USB sound device is unplugged while the client is talking in a channel. In this case ensure the application is processing the errors INTERR_SNDINPUT_FAILURE and INTERR_SNDOUTPUT_FAILURE in the WM_TEAMTALK_INTERNAL_ERROR event.

Read section Audio and Video Transmission to see how to transmit recorded audio to other users.


Typedef Documentation

typedef enum SoundSystem SoundSystem

The supported sound systems.

DirectSound is highly recommended on Windows 2K/XP/Vista.

See also:
SoundDevice
TT_InitSoundInputDevice
TT_InitSoundOutputDevice
typedef struct SoundDevice SoundDevice

A struct containing the properties of a sound device for either playback or recording.

Use nDeviceID to pass to TT_InitSoundInputDevice or TT_InitSoundOutputDevice.

Note that the nDeviceID may change if the user application is restarted and a new sound device is added or removed from the computer.

See also:
TT_GetSoundInputDevices
TT_GetSoundOutputDevices
typedef enum SoundLevel SoundLevel

An enum encapsulation the minimum, maximum and default sound levels for input and output sound devices.

Status of audio files being written to disk.

See also:
WM_TEAMTALK_USER_AUDIOFILE

Audio file formats supported for muxed audio recordings.

See also:
TT_StartRecordingMuxedAudioFile()
typedef struct AudioBlock AudioBlock

An audio block containing the raw audio from a user who was talking.

To enable audio blocks first call TT_EnableAudioBlockEvent() then whenever new audio is played the event WM_TEAMTALK_USER_AUDIOBLOCK is generated. Use TT_AcquireUserAudioBlock() to retrieve the audio block.

Note that each user is limited to 128 kbytes of audio data.

See also:
TT_EnableAudioBlockEvent()
TT_AcquireUserAudioBlock()
TT_ReleaseUserAudioBlock()

Enumeration Type Documentation

The supported sound systems.

DirectSound is highly recommended on Windows 2K/XP/Vista.

See also:
SoundDevice
TT_InitSoundInputDevice
TT_InitSoundOutputDevice
Enumerator:
SOUNDSYSTEM_WINMM 

Should be used on Windows CE.

SOUNDSYSTEM_DSOUND 

Should be used on Windows 2K/XP/Vista/7.

SOUNDSYSTEM_ALSA 

Should be used on Linux.

SOUNDSYSTEM_COREAUDIO 

Should be used on MacOS.

enum SoundLevel

An enum encapsulation the minimum, maximum and default sound levels for input and output sound devices.

Enumerator:
SOUND_VU_MAX 

The maximum value of recorded audio.

See also:
TT_GetSoundInputLevel
TT_SetVoiceActivationLevel
TT_GetVoiceActivationLevel
SOUND_VU_MIN 

The minimum value of recorded audio.

See also:
TT_GetSoundInputLevel
TT_SetVoiceActivationLevel
TT_GetVoiceActivationLevel
SOUND_VOLUME_MAX 

The maximum volume for master volume. To gain the volume level using software call TT_SetUserGainLevel.

See also:
TT_SetSoundOutputVolume
TT_GetSoundOutputVolume
TT_SetUserVolume
TT_GetUserVolume
SOUND_VOLUME_MIN 

The minimum volume for master volume.

See also:
TT_SetSoundOutputVolume
TT_GetSoundOutputVolume
TT_SetUserVolume
TT_GetUserVolume
SOUND_GAIN_MAX 

The maximum gain level.

A gain level of 32000 gains the volume by a factor 32. A gain level of SOUND_GAIN_DEFAULT means no gain.

See also:
TT_SetSoundInputGainLevel
TT_GetSoundInputGainLevel
TT_SetUserGainLevel
TT_GetUserGainLevel
SOUND_GAIN_DEFAULT 

The default gain level.

A gain level of 1000 means no gain. Check SOUND_GAIN_MAX and SOUND_GAIN_MIN to see how to increase and lower gain level.

See also:
TT_SetSoundInputGainLevel
TT_GetSoundInputGainLevel
TT_SetUserGainLevel
TT_GetUserGainLevel
SOUND_GAIN_MIN 

The minimum gain level (since it's zero it means silence).

A gain level of 100 is 1/10 of the default volume.

See also:
TT_SetSoundInputGainLevel
TT_GetSoundInputGainLevel
TT_SetUserGainLevel
TT_GetUserGainLevel

Status of audio files being written to disk.

See also:
WM_TEAMTALK_USER_AUDIOFILE
Enumerator:
AFS_ERROR 

Error while processing audio file.

AFS_STARTED 

Started processing audio file.

AFS_FINISHED 

Finished processing audio file.

AFS_ABORTED 

Aborted processing of audio file.

Audio file formats supported for muxed audio recordings.

See also:
TT_StartRecordingMuxedAudioFile()
Enumerator:
AFF_NONE 

Used to denote nothing selected.

AFF_WAVE_FORMAT 

Store in 16-bit wave format.

AFF_MP3_64KBIT_FORMAT 

Store in MP3-format.

This requires lame_enc.dll to be in the same directory as the application's execuable. The LAME DLLs can be obtained from http://lame.sourceforge.net. Note that the MP3-format is subject to licensing by Fraunhofer and Thomson Multimedia.

AFF_MP3_128KBIT_FORMAT 
See also:
AFF_MP3_64KBIT_FORMAT
AFF_MP3_256KBIT_FORMAT 
See also:
AFF_MP3_64KBIT_FORMAT
AFF_MP3_16KBIT_FORMAT 
See also:
AFF_MP3_64KBIT_FORMAT
AFF_MP3_32KBIT_FORMAT 
See also:
AFF_MP3_64KBIT_FORMAT

Function Documentation

TEAMTALKDLL_API BOOL TT_GetDefaultSoundDevices ( IN TTInstance lpTTInstance,
OUT INT32 *  lpnInputDeviceID,
OUT INT32 *  lpnOutputDeviceID 
)

Get the default sound devices.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
lpnInputDeviceID The ID of the default input device.
lpnOutputDeviceID The ID of the default output device.
See also:
TT_InitSoundInputDevice
TT_InitSoundOutputDevice
TEAMTALKDLL_API BOOL TT_GetSoundInputDevices ( IN TTInstance lpTTInstance,
IN OUT SoundDevice lpSoundDevices,
IN OUT INT32 *  lpnHowMany 
)

Get information about input devices for audio recording.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
lpSoundDevices Array of SoundDevice-structs where lpnHowMany holds the size of the array. Pass NULL as lpSoundDevices to query the number of devices.
lpnHowMany This is both an input and an output parameter. If lpSoundDevices is NULL lpnHowMany will after the call hold the number of devices, otherwise it should hold the size of the lpSoundDevices array.
See also:
TT_GetDefaultSoundDevices
TT_InitSoundInputDevice
TT_InitSoundOutputDevice
TEAMTALKDLL_API BOOL TT_GetSoundOutputDevices ( IN TTInstance lpTTInstance,
IN OUT SoundDevice lpSoundDevices,
IN OUT INT32 *  lpnHowMany 
)

Get the list of sound output devices for playback.

The nDeviceID of the SoundDevice struct should be passed to TT_InitSoundOutputDevice.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
lpSoundDevices Array of SoundDevice-structs where lpnHowMany holds the size of the array. Pass NULL as lpSoundDevices to query the number of devices.
lpnHowMany This is both an input and an output parameter. If lpSoundDevices is NULL lpnHowMany will after the call hold the number of devices, otherwise it should hold the size of the lpSoundDevices array.
See also:
TT_GetDefaultSoundDevices
TT_InitSoundOutputDevice
TEAMTALKDLL_API BOOL TT_InitSoundInputDevice ( IN TTInstance lpTTInstance,
IN INT32  nInputDeviceID 
)

Initialize the sound input devices (for recording audio).

The nDeviceID of the SoundDevice should be used as nInputDeviceID.

Callling this function will set the flag CLIENT_SNDINPUT_READY.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nInputDeviceID The nDeviceID of SoundDevice extracted through TT_GetSoundInputDevices.
See also:
SoundDevice
TT_GetDefaultSoundDevices
TT_GetSoundInputDevices
TT_CloseSoundInputDevice
TT_GetSoundInputLevel
TEAMTALKDLL_API BOOL TT_InitSoundOutputDevice ( IN TTInstance lpTTInstance,
IN INT32  nOutputDeviceID 
)

Initialize the sound output devices (for sound playback).

The nDeviceID of the SoundDevice should be used as nOutputDeviceID.

Callling this function will set the flag CLIENT_SNDOUTPUT_READY.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nOutputDeviceID The nDeviceID of SoundDevice extracted through TT_GetSoundOutputDevices.
See also:
SoundDevice
TT_GetDefaultSoundDevices
TT_GetSoundOutputDevices
TT_CloseSoundOutputDevice
TEAMTALKDLL_API BOOL TT_InitSoundDuplexDevices ( IN TTInstance lpTTInstance,
IN INT32  nInputDeviceID,
IN INT32  nOutputDeviceID 
)

Enable duplex mode where multiple audio streams are mixed into a single stream using software.

If TT_InitSoundDuplexDevices() is successful the following flags will be set:

Sound duplex mode is required for echo cancellation since sound input and output device must be synchronized. Also sound cards which does not support multiple output stream should use duplex mode.

Call TT_CloseSoundDuplexDevices() to shut down duplex mode.

Note that it is only the audio streams from users in the local client instance's current channel which will be mixed. If the local client instance calls TT_DoSubscribe() with SUBSCRIBE_INTERCEPT_AUDIO on a user in another channel then the audio from this user will be started in a separate stream. The reason for this is that the other user may use a different audio codec.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nInputDeviceID The nDeviceID of SoundDevice extracted through TT_GetSoundInputDevices.
nOutputDeviceID The nDeviceID of SoundDevice extracted through TT_GetSoundOutputDevices.
See also:
TT_InitSoundInputDevice()
TT_InitSoundOutputDevice()
TT_EnableEchoCancellation
TEAMTALKDLL_API BOOL TT_CloseSoundInputDevice ( IN TTInstance lpTTInstance  ) 

Shutdown the input sound device.

Callling this function will clear the flag CLIENT_SNDINPUT_READY.

If the local client instance is running in duplex mode (flag CLIENT_SNDINOUTPUT_DUPLEX is set) then trying to close the sound device will fail since duplex mode require that both input and output sound devices are active at the same time. Therefore in order to close sound devices running in duplex mode call TT_CloseSoundDuplexDevices().

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
Returns:
If running in sound duplex mode (CLIENT_SNDINOUTPUT_DUPLEX) then ensure to disable duplex mode prior to closing the sound device.
See also:
TT_InitSoundInputDevice
TEAMTALKDLL_API BOOL TT_CloseSoundOutputDevice ( IN TTInstance lpTTInstance  ) 

Shutdown the output sound device.

Callling this function will clear set the flag CLIENT_SNDOUTPUT_READY.

If the local client instance is running in duplex mode (flag CLIENT_SNDINOUTPUT_DUPLEX is set) then trying to close the sound device will fail since duplex mode require that both input and output sound devices are active at the same time. Therefore in order to close sound devices running in duplex mode call TT_CloseSoundDuplexDevices().

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
Returns:
If running in sound duplex mode (CLIENT_SNDINOUTPUT_DUPLEX) then ensure to disable duplex mode prior to closing the sound device.
See also:
TT_InitSoundOutputDevice
TEAMTALKDLL_API BOOL TT_CloseSoundDuplexDevices ( IN TTInstance lpTTInstance  ) 

Shut down sound devices running in duplex mode.

Calling this function only applies if sound devices has been initialized with TT_InitSoundDuplexDevices().

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
TEAMTALKDLL_API BOOL TT_StartSoundLoopbackTest ( IN TTInstance lpTTInstance,
IN INT32  nInputDeviceID,
IN INT32  nOutputDeviceID,
IN INT32  nSampleRate,
IN INT32  nChannels 
)

Perform a record and playback test of specified sound devices.

Call TT_StopSoundLoopbackTest() to stop the loopback test.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nInputDeviceID Should be the nDeviceID extracted through TT_GetSoundInputDevices.
nOutputDeviceID Should be the nDeviceID extracted through TT_GetSoundOutputDevices.
nSampleRate The sample rate the client's recorder should use.
nChannels Number of channels to use, i.e. 1 = mono, 2 = stereo Note that echo cancellation, denoising and AGC is not supported in stereo.
See also:
TT_InitSoundInputDevice()
TT_InitSoundOutputDevice()
TT_InitSoundDuplexDevices()
TT_StopSoundLoopbackTest
TEAMTALKDLL_API BOOL TT_StartSoundLoopbackTestEx ( IN TTInstance lpTTInstance,
IN INT32  nInputDeviceID,
IN INT32  nOutputDeviceID,
IN INT32  nSampleRate,
IN INT32  nChannels,
IN const AudioConfig lpAudioConfig,
IN BOOL  bEchoCancel 
)

Perform a record and playback test of specified sound devices along with an audio configuration and ability to try echo cancellation.

This function is almost like TT_StartSoundLoopbackTest() except that it allows the use of AudioConfig to enable AGC, denoising and AGC.

Call TT_StopSoundLoopbackTest() to stop the loopback test.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nInputDeviceID Should be the nDeviceID extracted through TT_GetSoundInputDevices.
nOutputDeviceID Should be the nDeviceID extracted through TT_GetSoundOutputDevices.
nSampleRate The sample rate the client's recorder should use.
nChannels Number of channels to use, i.e. 1 = mono, 2 = stereo. Note that echo cancellation, denoising and AGC is not supported in stereo.
lpAudioConfig The audio configuration to use, i.e. AGC and denoising properties.
bEchoCancel Whether to enable echo cancellation.
See also:
TT_InitSoundInputDevice()
TT_InitSoundOutputDevice()
TT_InitSoundDuplexDevices()
TT_StopSoundLoopbackTest()
TEAMTALKDLL_API BOOL TT_StopSoundLoopbackTest ( IN TTInstance lpTTInstance  ) 

Stop recorder and playback test.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
See also:
TT_InitSoundInputDevice
TT_InitSoundOutputDevice
TT_StartSoundLoopbackTest
TEAMTALKDLL_API INT32 TT_GetSoundInputLevel ( IN TTInstance lpTTInstance  ) 

Get the volume level of the current recorded audio.

The current level is updated at an interval specified in a channel's AudioCodec.

Note that the volume level will not be available until the client instance joins a channel, i.e. it knows what sample rate to use.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
Returns:
Returns a value between SOUND_VU_MIN and SOUND_VU_MAX.
TEAMTALKDLL_API BOOL TT_SetSoundInputGainLevel ( IN TTInstance lpTTInstance,
IN INT32  nLevel 
)

Set voice gaining of recorded audio.

The gain level ranges from SOUND_GAIN_MIN to SOUND_GAIN_MAX where SOUND_GAIN_DEFAULT is no gain. So 100 is 1/10 of the original volume and 8000 is 8 times the original volume.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nLevel A value from SOUND_GAIN_MIN to SOUND_GAIN_MAX.
See also:
TT_GetSoundInputGainLevel
TEAMTALKDLL_API INT32 TT_GetSoundInputGainLevel ( IN TTInstance lpTTInstance  ) 

Get voice gain level of outgoing audio.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
Returns:
A value from SOUND_GAIN_MIN to SOUND_GAIN_MAX.
See also:
TT_SetSoundInputGainLevel
TEAMTALKDLL_API BOOL TT_SetSoundOutputVolume ( IN TTInstance lpTTInstance,
IN INT32  nVolume 
)

Set master volume.

If still not loud enough use TT_SetUserGainLevel.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nVolume A value from SOUND_VOLUME_MIN to SOUND_VOLUME_MAX.
See also:
TT_SetUserVolume
TEAMTALKDLL_API INT32 TT_GetSoundOutputVolume ( IN TTInstance lpTTInstance  ) 

Get master volume.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
Returns:
Returns the master volume.
See also:
SOUND_VOLUME_MAX
SOUND_VOLUME_MIN
TT_GetUserVolume
TEAMTALKDLL_API BOOL TT_SetSoundOutputMute ( IN TTInstance lpTTInstance,
IN BOOL  bMuteAll 
)

Set all users mute.

To stop receiving audio from a user call TT_DoUnsubscribe.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
bMuteAll Whether to mute or unmute all users.
See also:
CLIENT_SNDOUTPUT_MUTE
TEAMTALKDLL_API BOOL TT_EnableDenoising ( IN TTInstance lpTTInstance,
IN BOOL  bEnable 
)

Enable denoising of recorded audio.

This call will enable/disable the CLIENT_SNDINPUT_DENOISING flag. Denoising will not be active if the local client instance is participating in a channel which uses a stereo AudioCodec.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
bEnable TRUE to enable, otherwise FALSE.
See also:
TT_SetDenoiseLevel()
TEAMTALKDLL_API BOOL TT_SetDenoiseLevel ( IN TTInstance lpTTInstance,
IN INT32  nLevel 
)

Set the denoise level of recorded audio.

Setting denoise level is only valid if TT_GetFlags() contains CLIENT_SNDINPUT_DENOISING.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nLevel Maximum attenuation of the noise in dB. Negative value! Default value is -15.
See also:
TT_EnableDenoising()
TEAMTALKDLL_API INT32 TT_GetDenoiseLevel ( IN TTInstance lpTTInstance  ) 

Set the denoise level of recorded audio.

Getting denoise level is only valid if TT_GetFlags() contains CLIENT_SNDINPUT_DENOISING.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
Returns:
Maximum attenuation of the noise in dB. Negative value!
See also:
TT_SetDenoiseLevel()
TEAMTALKDLL_API BOOL TT_EnableEchoCancellation ( IN TTInstance lpTTInstance,
IN BOOL  bEnable 
)

Enable/disable acoustic echo cancellation (AEC).

In order to enable echo cancellation mode the local client instance must first be set in sound duplex mode by calling TT_InitSoundDuplexDevices(). This is because the echo canceller must first mixed all audio streams into a single stream and have then run in synch with the input stream. After calling TT_InitSoundDuplexDevices() the flag CLIENT_SNDINOUTPUT_DUPLEX will be set.

For echo cancellation to work the sound input and output device must be the same sound card since the input and output stream must be completely synchronized. Also it is recommended to also enable denoising and AGC for better echo cancellation by calling TT_EnableDenoising() and TT_EnableAGC() respectively. Using an AudioConfig on a Channel can also be use to automatically enable denoising and AGC.

Echo cancellation will not be active if the local client instance is participating in a channel which uses a stereo AudioCodec.

After calling TT_EnableEchoCancellation() the flag CLIENT_SNDINPUT_AEC will be set.

Note that Windows Mobile/CE doesn't support echo cancellation.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
bEnable Whether to enable or disable echo callation.
See also:
TT_EnableDenoising()
TT_EnableAGC()
TT_InitSoundInputDevice()
TT_InitSoundOutputDevice()
TEAMTALKDLL_API BOOL TT_EnableAGC ( IN TTInstance lpTTInstance,
IN BOOL  bEnable 
)

Enable Automatic Gain Control.

Each Channel can also be configured to automatically enable the local client instance to enable AGC by specifying the bEnableAGC member of AudioConfig.

AGC will not be active if the local client instance is participating in a channel which uses a stereo AudioCodec.

Note that Windows Mobile/CE doesn't support AGC.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
bEnable Whether to enable AGC.
See also:
CLIENT_SNDINPUT_AGC
TT_SetAGCSettings
TEAMTALKDLL_API BOOL TT_SetAGCSettings ( IN TTInstance lpTTInstance,
IN INT32  nGainLevel,
IN INT32  nMaxIncrement,
IN INT32  nMaxDecrement,
IN INT32  nMaxGain 
)

Set Automatic Gain Control (AGC) settings.

Since microphone volumes may vary AGC can be used to adjust a signal to a reference volume. That way users will speak at the same volume level.

Calling TT_SetAGCSettings() is only valid if TT_GetFlags() contains CLIENT_SNDINPUT_AGC.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nGainLevel A value from 0 to 32768. Default is 8000.
nMaxIncrement Used so volume should not be amplified too quickly (maximal gain increase in dB/second). Default is 12.
nMaxDecrement Negative value! Used so volume should not be attenuated too quickly (maximal gain decrease in dB/second). Default is -40.
nMaxGain Ensure volume doesn't become too loud (maximal gain in dB). Default is 30.
See also:
TT_EnableAGC
TEAMTALKDLL_API BOOL TT_GetAGCSettings ( IN TTInstance lpTTInstance,
OUT INT32 *  lpnGainLevel,
OUT INT32 *  lpnMaxIncrement,
OUT INT32 *  lpnMaxDecrement,
OUT INT32 *  lpnMaxGain 
)

Get Automatic Gain Control settings.

Calling TT_GetAGCSettings() is only valid if TT_GetFlags() contains CLIENT_SNDINPUT_AGC.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
lpnGainLevel A value from 0 to 32768.
lpnMaxIncrement Used so volume should not be amplified too quickly (maximal gain increase in dB/second).
lpnMaxDecrement Negative value! Used so volume should not be attenuated too quickly (maximal gain decrease in dB/second).
lpnMaxGain Ensure volume doesn't become too loud (maximal gain in dB).
See also:
TT_EnableAGC
TEAMTALKDLL_API BOOL TT_Enable3DSoundPositioning ( IN TTInstance lpTTInstance,
IN BOOL  bEnable 
)

Enable automatically position users using 3D-sound.

Note that 3d-sound does not work if sound is running in duplex mode (CLIENT_SNDINOUTPUT_DUPLEX).

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
bEnable TRUE to enable, otherwise FALSE.
See also:
TT_SetUserPosition
TEAMTALKDLL_API BOOL TT_AutoPositionUsers ( IN TTInstance lpTTInstance  ) 

Automatically position users using 3D-sound.

Note that 3d-sound does not work if sound is running in duplex mode (CLIENT_SNDINOUTPUT_DUPLEX).

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
See also:
TT_SetUserPosition
TEAMTALKDLL_API BOOL TT_EnableAudioBlockEvent ( IN TTInstance lpTTInstance,
IN BOOL  bEnable 
)

Enable/disable access to user's raw audio.

With audio block event enabled all audio which has been played will be accessible by calling TT_AcquireUserAudioBlock(). Every time a new AudioBlock is available the event WM_TEAMTALK_USER_AUDIOBLOCK is generated.

See also:
TT_AcquireUserAudioBlock()
TT_ReleaseUserAudioBlock()
WM_TEAMTALK_USER_AUDIOBLOCK
TEAMTALKDLL_API BOOL TT_SetUserVolume ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN INT32  nVolume 
)

Set the volume of a user.

Note that it's a virtual volume which is being set since the master volume affects the user volume.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID The ID of the user whose volume will be changed.
nVolume Must be between SOUND_VOLUME_MIN and SOUND_VOLUME_MAX.
See also:
TT_SetSoundOutputVolume
TEAMTALKDLL_API INT32 TT_GetUserVolume ( IN TTInstance lpTTInstance,
IN INT32  nUserID 
)

Get the volume of a user.

Note that it's a virtual volume which is being set since the master volume affects the user volume.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID The ID of the user.
Returns:
A value between SOUND_VOLUME_MIN and SOUND_VOLUME_MAX
TEAMTALKDLL_API BOOL TT_SetUserGainLevel ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN INT32  nGainLevel 
)

Use software to gain a user's volume.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID The ID of the user who should have sound gained.
nGainLevel The gain level for the user. A value from SOUND_GAIN_MIN to SOUND_GAIN_MAX
See also:
TT_GetUserGainLevel
SOUND_GAIN_DEFAULT
TEAMTALKDLL_API INT32 TT_GetUserGainLevel ( IN TTInstance lpTTInstance,
IN INT32  nUserID 
)

Get the software gain level for a user.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID The ID of the user whose gain level should be retrieved.
See also:
TT_SetUserGainLevel
Returns:
The gain level for the user. A value from SOUND_GAIN_MIN to SOUND_GAIN_MAX
TEAMTALKDLL_API BOOL TT_SetUserMute ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN BOOL  bMute 
)

Mute a user.

To stop receiving audio from a user call TT_DoUnsubscribe with SUBSCRIBE_AUDIO.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID The user ID of the user to mute (or unmute).
bMute TRUE will mute, FALSE will unmute.
See also:
TT_SetSoundOutputMute
TEAMTALKDLL_API BOOL TT_SetUserStoppedTalkingDelay ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN INT32  nDelayMSec 
)

Set the delay of when a user should be considered to no longer be talking.

When a user starts talking the WM_TEAMTALK_USER_TALKING is triggered with its parameter set to active. A user will remain in this active state until no packets are received from this user, plus a delay (due to network interruptions). This delay is by default set to 500 msec but can be changed by calling TT_SetUserStoppedTalkingDelay().

See also:
TT_GetUserStoppedTalkingDelay
TEAMTALKDLL_API INT32 TT_GetUserStoppedTalkingDelay ( IN TTInstance lpTTInstance,
IN INT32  nUserID 
)

Get the delay of when a user should no longer be considered as talking.

Returns:
The delay in miliseconds. -1 on error.
See also:
TT_SetUserStoppedTalkingDelay
TEAMTALKDLL_API BOOL TT_SetUserPosition ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN float  x,
IN float  y,
IN float  z 
)

Set the position of a user.

This can only be done using DirectSound (SOUNDSYSTEM_DSOUND) and with sound duplex mode (CLIENT_SNDINOUTPUT_DUPLEX) disabled.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID ID of user.
x Distance in meters to user (left/right).
y Distance in meters to user (back/forward).
z Distance in meters to user (up/down).
TEAMTALKDLL_API BOOL TT_GetUserPosition ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
OUT float *  x,
OUT float *  y,
OUT float *  z 
)

Get a user's position.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID ID of user.
x Distance in meters to user (left/right).
y Distance in meters to user (back/forward).
z Distance in meters to user (up/down).
TEAMTALKDLL_API BOOL TT_SetUserStereo ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN BOOL  bLeftSpeaker,
IN BOOL  bRightSpeaker 
)

Set whether a user should speak in the left, right or both speakers. This function only works if AudioCodec has been set to use stereo.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID ID of user.
bLeftSpeaker TRUE if user should be played in left speaker.
bRightSpeaker TRUE if user should be played in right speaker.
See also:
TT_GetUserStereo
TEAMTALKDLL_API BOOL TT_GetUserStereo ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
OUT BOOL *  lpbLeftSpeaker,
OUT BOOL *  lpbRightSpeaker 
)

Check what speaker a user is outputting to.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID ID of user.
lpbLeftSpeaker TRUE if playing in left speaker.
lpbRightSpeaker TRUE if playing in right speaker.
See also:
TT_SetUserStereo
TEAMTALKDLL_API BOOL TT_SetUserAudioFolder ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN const TTCHAR szFolderPath,
IN const TTCHAR szFileNameVars,
IN AudioFileFormat  uAFF 
)

Store user's audio to disk.

Set the path of where to store audio from a user to disk. To store in MP3 format instead of .wav format ensure that the LAME MP3 encoder file lame_enc.dll is placed in the same directory as the SDKs DLL files. To stop recording set szFolderPath to an empty string and uAFF to AFF_NONE.

To store audio of users not in current channel of the client instance check out the section Spying on Users.

Parameters:
lpTTInstance Pointer to client instance created by TT_InitTeamTalk.
nUserID The ID of the User which should store audio to disk.
szFolderPath The path on disk to where files should be stored. This value will be stored in szAudioFolder of User.
szFileNameVars The file name used for audio files can consist of the following variables: %nickname%, %username%, %userid%, %counter% and a specified time based on strftime (google 'strftime' for a description of the format. The default format used by TeamTalk is: '%Y%m%d-%H%M%S #%userid% %username%'. The %counter% variable is a 9 digit integer which is incremented for each audio file. The file extension is automatically appended based on the file type (.wav for AFF_WAVE_FORMAT and .mp3 for AFF_MP3_*_FORMAT). Pass NULL or empty string to revert to default format.
uAFF The AudioFileFormat to use for storing audio files. Passing AFF_NONE will cancel/reset the current recording.
Returns:
FALSE if path is invalid, otherwise TRUE.
See also:
User
WM_TEAMTALK_USER_AUDIOFILE
TEAMTALKDLL_API BOOL TT_AcquireUserAudioBlock ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
OUT AudioBlock lpAudioBlock 
)

Extract the raw audio from a user who has been talking.

To enable access to user's raw audio first call TT_EnableAudioBlockEvent(). Whenever new audio becomes available the event WM_TEAMTALK_USER_AUDIOBLOCK is generated and TT_AcquireUserAudioBlock() can be called to extract the audio.

The AudioBlock contains shared memory with the local client instance therefore always remember to call TT_ReleaseUserAudioBlock() to release the shared memory.

If TT_AcquireUserAudioBlock() is called multiple times without calling TT_ReleaseUserAudioBlock() then the same AudioBlock will be retrieved again.

See also:
TT_ReleaseUserAudioBlock()
TT_EnableAudioBlockEvent()
WM_TEAMTALK_USER_AUDIOBLOCK
TEAMTALKDLL_API BOOL TT_ReleaseUserAudioBlock ( IN TTInstance lpTTInstance,
IN INT32  nUserID 
)

Release the shared memory of an AudioBlock.

All AudioBlock-structures extracted through TT_AcquireUserAudioBlock() must be released again since they share memory with the local client instance.

Never access lpRawAudio after releasing its AudioBlock. This will cause the application to crash with a memory exception.

See also:
TT_AcquireUserAudioBlock()
WM_TEAMTALK_USER_AUDIOBLOCK
TEAMTALKDLL_API BOOL TT_ReleaseAllAudioBlocks ( IN TTInstance lpTTInstance  ) 

Release all audio blocks of the local client instance.

This function is only for convenience to ensure that no memory is leaked. Normally TT_ReleaseUserAudioBlock() should be used to release AudioBlock-data.

See also:
TT_ReleaseUserAudioBlock()
WM_TEAMTALK_USER_AUDIOBLOCK
Generated on Sun Mar 18 17:18:33 2012 for TeamTalk 4 C-API DLL by  doxygen 1.6.3