Sound Capture and Playback

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

Classes

struct  BearWare.SoundDevice
 A struct containing the properties of a sound device for either playback or recording. More...
struct  BearWare.SoundLevel
 An enum encapsulation the minimum, maximum and default sound levels for input and output sound devices. More...
struct  BearWare.AudioBlock
 An audio block containing the raw audio from a user who was talking. More...

Enumerations

enum  BearWare.SoundSystem { BearWare.SOUNDSYSTEM_WINMM = 1, BearWare.SOUNDSYSTEM_DSOUND = 2, BearWare.SOUNDSYSTEM_ALSA = 3 }
 

The supported sound systems.

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

Status of audio files being written to disk.

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

Audio file formats supported for muxed audio recordings.

More...

Functions

bool BearWare::TeamTalk4.GetDefaultSoundDevices (out int lpnInputDeviceID, out int lpnOutputDeviceID)
 Get the default sound devices.
bool BearWare::TeamTalk4.GetSoundInputDevices (out SoundDevice[] lpSoundDevices)
 Get information about input devices for audio recording.
bool BearWare::TeamTalk4.GetSoundOutputDevices (out SoundDevice[] lpSoundDevices)
 Get the list of sound output devices for playback.
bool BearWare::TeamTalk4.InitSoundInputDevice (int nInputDeviceID)
 Initialize the sound input devices (for recording audio).
bool BearWare::TeamTalk4.InitSoundOutputDevice (int nOutputDeviceID)
 Initialize the sound output devices (for sound playback).
bool BearWare::TeamTalk4.InitSoundDuplexDevices (int nInputDeviceID, int nOutputDeviceID)
 Enable duplex mode where multiple audio streams are mixed into a single stream using software.
bool BearWare::TeamTalk4.CloseSoundInputDevice ()
 Shutdown the input sound device.
bool BearWare::TeamTalk4.CloseSoundOutputDevice ()
 Shutdown the output sound device.
bool BearWare::TeamTalk4.CloseSoundDuplexDevices ()
 Shut down sound devices running in duplex mode.
bool BearWare::TeamTalk4.StartSoundLoopbackTest (int nInputDeviceID, int nOutputDeviceID, int nSampleRate, int nChannels)
 Perform a record and playback test of specified sound devices.
bool BearWare::TeamTalk4.StartSoundLoopbackTestEx (int nInputDeviceID, int nOutputDeviceID, int nSampleRate, int nChannels, AudioConfig lpAudioConfig, bool bEchoCancel)
 Perform a record and playback test of specified sound devices along with an audio configuration and ability to try echo cancellation.
bool BearWare::TeamTalk4.StopSoundLoopbackTest ()
 Stop recorder and playback test.
int BearWare::TeamTalk4.GetSoundInputLevel ()
 Get the volume level of the current recorded audio.
bool BearWare::TeamTalk4.SetSoundInputGainLevel (int nLevel)
 Set voice gaining of recorded audio.
int BearWare::TeamTalk4.GetSoundInputGainLevel ()
 Get voice gain level of outgoing audio.
bool BearWare::TeamTalk4.SetSoundOutputVolume (int nVolume)
 Set master volume.
int BearWare::TeamTalk4.GetSoundOutputVolume ()
 Get master volume.
bool BearWare::TeamTalk4.SetSoundOutputMute (bool bMuteAll)
 Set all users mute.
bool BearWare::TeamTalk4.EnableDenoising (bool bEnable)
 Enable denoising of recorded audio.
bool BearWare::TeamTalk4.SetDenoiseLevel (int nLevel)
 Set the denoise level of recorded audio.
int BearWare::TeamTalk4.GetDenoiseLevel ()
 Set the denoise level of recorded audio.
bool BearWare::TeamTalk4.EnableEchoCancellation (bool bEnable)
 Enable/disable acoustic echo cancellation (AEC).
bool BearWare::TeamTalk4.EnableAGC (bool bEnable)
 Enable Automatic Gain Control.
bool BearWare::TeamTalk4.SetAGCSettings (int nGainLevel, int nMaxIncrement, int nMaxDecrement, int nMaxGain)
 Set Automatic Gain Control (AGC) settings.
bool BearWare::TeamTalk4.GetAGCSettings (out int lpnGainLevel, out int lpnMaxIncrement, out int lpnMaxDecrement, out int lpnMaxGain)
 Get Automatic Gain Control settings.
bool BearWare::TeamTalk4.Enable3DSoundPositioning (bool bEnable)
 Enable automatically position users using 3D-sound.
bool BearWare::TeamTalk4.AutoPositionUsers ()
 Automatically position users using 3D-sound.
bool BearWare::TeamTalk4.EnableAudioBlockEvent (bool bEnable)
 Enable/disable access to user's raw audio.
bool BearWare::TeamTalk4.SetUserVolume (int nUserID, int nVolume)
 Set the volume of a user.
int BearWare::TeamTalk4.GetUserVolume (int nUserID)
 Get the volume of a user.
bool BearWare::TeamTalk4.SetUserGainLevel (int nUserID, int nGainLevel)
 Use software to gain a user's volume.
int BearWare::TeamTalk4.GetUserGainLevel (int nUserID)
 Get the software gain level for a user.
bool BearWare::TeamTalk4.SetUserMute (int nUserID, bool bMute)
 Mute a user.
bool BearWare::TeamTalk4.SetUserStoppedTalkingDelay (int nUserID, int nDelayMSec)
 Set the delay of when a user should be considered to no longer be talking.
int BearWare::TeamTalk4.GetUserStoppedTalkingDelay (int nUserID)
 Get the delay of when a user should no longer be considered as talking.
bool BearWare::TeamTalk4.SetUserPosition (int nUserID, float x, float y, float z)
 Set the position of a user.
bool BearWare::TeamTalk4.GetUserPosition (int nUserID, out float x, out float y, out float z)
 Get a user's position.
bool BearWare::TeamTalk4.SetUserStereo (int nUserID, bool bLeftSpeaker, bool bRightSpeaker)
 Set whether a user should speak in the left, right or both speakers. This function only works if BearWare.AudioCodec has been set to use stereo.
bool BearWare::TeamTalk4.GetUserStereo (int nUserID, out bool lpbLeftSpeaker, out bool lpbRightSpeaker)
 Check what speaker a user is outputting to.
bool BearWare::TeamTalk4.SetUserAudioFolder (int nUserID, string szFolderPath, string szFileNameVars, AudioFileFormat uAFF)
 Store audio conversations to disk.
bool BearWare::TeamTalk4.AcquireUserAudioBlock (int nUserID, ref AudioBlock lpAudioBlock)
 Extract the raw audio from a user who has been talking.
bool BearWare::TeamTalk4.ReleaseUserAudioBlock (int nUserID)
 Release the shared memory of an BearWare.AudioBlock.
bool BearWare::TeamTalk4.ReleaseAllUserAudioBlocks ()
 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 TeamTalk4.GetSoundInputDevices() and TeamTalk4.GetSoundOutputDevices(). These two functions return arrays of BearWare.SoundDevice-structs which contains a description of the sound device. In the BearWare.SoundDevice-struct there's a member variable called nDeviceID. This ID should be passed to the client instance's two sound initialization functions TeamTalk4.InitSoundInputDevice() and TeamTalk4.InitSoundOutputDevice(). Once this has been done the TeamTalk4.GetFlags() call will return a value containing the mask bits ClientFlag.CLIENT_SNDINPUT_READY and ClientFlag.CLIENT_SNDOUTPUT_READY.

A computer's default sound devices can be queried using TeamTalk4.GetDefaultSoundDevices(). A loop-back test of the selected sound devices can be performed using TeamTalk4.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 ClientError.INTERR_SNDINPUT_FAILURE and ClientError.INTERR_SNDOUTPUT_FAILURE in the TeamTalk4.OnInternalError() event.

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


Enumeration Type Documentation

The supported sound systems.

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

See also:
SoundDevice
TeamTalk4.InitSoundInputDevice
TeamTalk4.InitSoundOutputDevice
Enumerator:
SOUNDSYSTEM_WINMM 

Should be used on Windows CE.

SOUNDSYSTEM_DSOUND 

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

SOUNDSYSTEM_ALSA 

Should be used on Linux.

Status of audio files being written to disk.

See also:
OnUserAudioFile
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:
TeamTalk4.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:
AudioFileFormat.AFF_MP3_64KBIT_FORMAT
AFF_MP3_256KBIT_FORMAT 
See also:
AudioFileFormat.AFF_MP3_64KBIT_FORMAT
AFF_MP3_16KBIT_FORMAT 
See also:
AudioFileFormat.AFF_MP3_64KBIT_FORMAT
AFF_MP3_32KBIT_FORMAT 
See also:
AudioFileFormat.AFF_MP3_64KBIT_FORMAT

Function Documentation

bool BearWare.TeamTalk4.GetDefaultSoundDevices ( out int  lpnInputDeviceID,
out int  lpnOutputDeviceID 
) [inherited]

Get the default sound devices.

Parameters:
lpnInputDeviceID The ID of the default input device.
lpnOutputDeviceID The ID of the default output device.
See also:
TeamTalk4.InitSoundInputDevice
TeamTalk4.InitSoundOutputDevice
bool BearWare.TeamTalk4.GetSoundInputDevices ( out SoundDevice[]  lpSoundDevices  )  [inherited]

Get information about input devices for audio recording.

Parameters:
lpSoundDevices An output array of BearWare.SoundDevice-structs which will receive the available sound input devices.
See also:
TeamTalk4.GetDefaultSoundDevices
TeamTalk4.InitSoundInputDevice
TeamTalk4.InitSoundOutputDevice
bool BearWare.TeamTalk4.GetSoundOutputDevices ( out SoundDevice[]  lpSoundDevices  )  [inherited]

Get the list of sound output devices for playback.

The nDeviceID of the BearWare.SoundDevice struct should be passed to InitSoundOutputDevice.

Parameters:
lpSoundDevices An output array of BearWare.SoundDevice-structs which will receive the available sound output devices.
See also:
TeamTalk4.GetDefaultSoundDevices
TeamTalk4.InitSoundOutputDevice
bool BearWare.TeamTalk4.InitSoundInputDevice ( int  nInputDeviceID  )  [inherited]

Initialize the sound input devices (for recording audio).

The nDeviceID of the BearWare.SoundDevice should be used as nInputDeviceID.

Calling this function will set the flag ClientFlag.CLIENT_SNDINPUT_READY.

Parameters:
nInputDeviceID The nDeviceID of BearWare.SoundDevice extracted through GetSoundInputDevices.
See also:
BearWare.SoundDevice
GetDefaultSoundDevices
GetSoundInputDevices
CloseSoundInputDevice
GetSoundInputLevel
bool BearWare.TeamTalk4.InitSoundOutputDevice ( int  nOutputDeviceID  )  [inherited]

Initialize the sound output devices (for sound playback).

The nDeviceID of the BearWare.SoundDevice should be used as nOutputDeviceID.

Callling this function will set the flag ClientFlag.CLIENT_SNDOUTPUT_READY.

Parameters:
nOutputDeviceID Should be the nDeviceID of BearWare.SoundDevice extracted through GetSoundOutputDevices().
See also:
BearWare.SoundDevice
TeamTalk4.GetDefaultSoundDevices
TeamTalk4.GetSoundOutputDevices
TeamTalk4.CloseSoundOutputDevice
bool BearWare.TeamTalk4.InitSoundDuplexDevices ( int  nInputDeviceID,
int  nOutputDeviceID 
) [inherited]

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:

  • ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX
  • ClientFlag.CLIENT_SNDOUTPUT_READY
  • ClientFlag.CLIENT_SNDINPUT_READY

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 TeamTalk4.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 TeamTalk4.DoSubscribe() with Subscribe.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:
nInputDeviceID The nDeviceID of BearWare.SoundDevice extracted through GetSoundInputDevices().
nOutputDeviceID The nDeviceID of BearWare.SoundDevice extracted through GetSoundOutputDevices().
See also:
TeamTalk4.InitSoundInputDevice()
TeamTalk4.InitSoundOutputDevice()
TeamTalk4.EnableEchoCancellation
bool BearWare.TeamTalk4.CloseSoundInputDevice (  )  [inherited]

Shutdown the input sound device.

Callling this function will clear the flag ClientFlag.CLIENT_SNDINPUT_READY.

If the local client instance is running in duplex mode (flag ClientFlag.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 TeamTalk4.CloseSoundDuplexDevices().

Returns:
If running in sound duplex mode (ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX) then ensure to disable duplex mode prior to closing the sound device.
See also:
TeamTalk4.InitSoundInputDevice
bool BearWare.TeamTalk4.CloseSoundOutputDevice (  )  [inherited]

Shutdown the output sound device.

Callling this function will clear set the flag ClientFlag.CLIENT_SNDOUTPUT_READY.

If the local client instance is running in duplex mode (flag ClientFlag.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 TeamTalk4.CloseSoundDuplexDevices().

Returns:
If running in sound duplex mode (ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX) then ensure to disable duplex mode prior to closing the sound device.
See also:
TeamTalk4.InitSoundOutputDevice
bool BearWare.TeamTalk4.CloseSoundDuplexDevices (  )  [inherited]

Shut down sound devices running in duplex mode.

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

bool BearWare.TeamTalk4.StartSoundLoopbackTest ( int  nInputDeviceID,
int  nOutputDeviceID,
int  nSampleRate,
int  nChannels 
) [inherited]

Perform a record and playback test of specified sound devices.

Call StopSoundLoopbackTest() to stop the loopback test.

Parameters:
nInputDeviceID Should be the nDeviceID extracted through GetSoundInputDevices.
nOutputDeviceID Should be the nDeviceID extracted through 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:
TeamTalk4.InitSoundInputDevice()
TeamTalk4.InitSoundOutputDevice()
TeamTalk4.StopSoundLoopbackTest()
bool BearWare.TeamTalk4.StartSoundLoopbackTestEx ( int  nInputDeviceID,
int  nOutputDeviceID,
int  nSampleRate,
int  nChannels,
AudioConfig  lpAudioConfig,
bool  bEchoCancel 
) [inherited]

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 BearWare.AudioConfig to enable AGC, denoising and AGC.

Call TT_StopSoundLoopbackTest() to stop the loopback test.

Parameters:
nInputDeviceID Should be the nDeviceID extracted through TeamTalk4.GetSoundInputDevices().
nOutputDeviceID Should be the nDeviceID extracted through TeamTalk4.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:
TeamTalk4.InitSoundInputDevice()
TeamTalk4.InitSoundOutputDevice()
TeamTalk4.InitSoundDuplexDevices()
TeamTalk4.StopSoundLoopbackTest()
bool BearWare.TeamTalk4.StopSoundLoopbackTest (  )  [inherited]
int BearWare.TeamTalk4.GetSoundInputLevel (  )  [inherited]

Get the volume level of the current recorded audio.

The current level is updated at an interval specified in a channel's BearWare.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.

Returns:
Returns a value between BearWare.SoundLevel.SOUND_VU_MIN and BearWare.SoundLevel.SOUND_VU_MAX
bool BearWare.TeamTalk4.SetSoundInputGainLevel ( int  nLevel  )  [inherited]

Set voice gaining of recorded audio.

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

Parameters:
nLevel A value from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX.
See also:
TeamTalk4.GetSoundInputGainLevel
int BearWare.TeamTalk4.GetSoundInputGainLevel (  )  [inherited]

Get voice gain level of outgoing audio.

Returns:
A value from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX.
See also:
SetSoundInputGainLevel
bool BearWare.TeamTalk4.SetSoundOutputVolume ( int  nVolume  )  [inherited]

Set master volume.

If still not loud enough use SetUserGainLevel().

Parameters:
nVolume A value from BearWare.SoundLevel.SOUND_VOLUME_MIN to BearWare.SoundLevel.SOUND_VOLUME_MAX.
See also:
TeamTalk4.SetUserVolume
int BearWare.TeamTalk4.GetSoundOutputVolume (  )  [inherited]

Get master volume.

Returns:
Returns the master volume.
See also:
BearWare.SoundLevel.SOUND_VOLUME_MAX
BearWare.SoundLevel.SOUND_VOLUME_MIN
TeamTalk4.GetUserVolume
bool BearWare.TeamTalk4.SetSoundOutputMute ( bool  bMuteAll  )  [inherited]

Set all users mute.

To stop receiving audio from a user call DoUnsubscribe().

Parameters:
bMuteAll Whether to mute or unmute all users.
See also:
ClientFlag.CLIENT_SNDOUTPUT_MUTE
bool BearWare.TeamTalk4.EnableDenoising ( bool  bEnable  )  [inherited]

Enable denoising of recorded audio.

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

Parameters:
bEnable TRUE to enable, otherwise FALSE.
See also:
TeamTalk4.SetDenoiseLevel()
bool BearWare.TeamTalk4.SetDenoiseLevel ( int  nLevel  )  [inherited]

Set the denoise level of recorded audio.

Setting denoise level is only valid if TeamTalk4.GetFlags() contains ClientFlag.CLIENT_SNDINPUT_DENOISING.

Parameters:
nLevel Maximum attenuation of the noise in dB. Negative value! Default value is -15.
See also:
TeamTalk4.EnableDenoising()
int BearWare.TeamTalk4.GetDenoiseLevel (  )  [inherited]

Set the denoise level of recorded audio.

Getting denoise level is only valid if TeamTalk4.GetFlags() contains ClientFlag.CLIENT_SNDINPUT_DENOISING.

Returns:
Maximum attenuation of the noise in dB. Negative value!
See also:
TeamTalk4.SetDenoiseLevel()
bool BearWare.TeamTalk4.EnableEchoCancellation ( bool  bEnable  )  [inherited]

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 TeamTalk4.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 TeamTalk4.InitSoundDuplexDevices() the flag ClientFlag.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 TeamTalk4.EnableDenoising() and TeamTalk4.EnableAGC() respectively. Using an BearWare.AudioConfig on a BearWare.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 BearWare.AudioCodec.

After calling TeamTalk4.EnableEchoCancellation() the flag ClientFlag.CLIENT_SNDINPUT_AEC will be set.

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

Parameters:
bEnable Whether to enable or disable echo callation.
See also:
TeamTalk4.EnableDenoising()
TeamTalk4.EnableAGC()
bool BearWare.TeamTalk4.EnableAGC ( bool  bEnable  )  [inherited]

Enable Automatic Gain Control.

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

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

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

Parameters:
bEnable Whether to enable AGC.
See also:
ClientFlag.CLIENT_SNDINPUT_AGC
TeamTalk4.SetAGCSettings()
bool BearWare.TeamTalk4.SetAGCSettings ( int  nGainLevel,
int  nMaxIncrement,
int  nMaxDecrement,
int  nMaxGain 
) [inherited]

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 TeamTalk4.SetAGCSettings() is only valid if TeamTalk4.GetFlags() contains ClientFlag.CLIENT_SNDINPUT_AGC.

Parameters:
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:
TeamTalk4.EnableAGC()
bool BearWare.TeamTalk4.GetAGCSettings ( out int  lpnGainLevel,
out int  lpnMaxIncrement,
out int  lpnMaxDecrement,
out int  lpnMaxGain 
) [inherited]

Get Automatic Gain Control settings.

Calling TeamTalk4.GetAGCSettings() is only valid if TeamTalk4.GetFlags() contains ClientFlag.CLIENT_SNDINPUT_AGC.

Parameters:
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:
TeamTalk4.EnableAGC
bool BearWare.TeamTalk4.Enable3DSoundPositioning ( bool  bEnable  )  [inherited]

Enable automatically position users using 3D-sound.

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

Parameters:
bEnable TRUE to enable, otherwise FALSE.
See also:
TeamTalk4.SetUserPosition
bool BearWare.TeamTalk4.AutoPositionUsers (  )  [inherited]

Automatically position users using 3D-sound.

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

See also:
TeamTalk4.SetUserPosition
bool BearWare.TeamTalk4.EnableAudioBlockEvent ( bool  bEnable  )  [inherited]

Enable/disable access to user's raw audio.

With audio callbacks enabled all audio which has been played will be accessible by calling TeamTalk4.AcquireUserAudioBlock(). Every time a new BearWare.AudioBlock is available the event OnUserAudioBlock() is generated.

See also:
TeamTalk4.AcquireUserAudioBlock()
TeamTalk4.ReleaseUserAudioBlock()
OnUserAudioBlock()
bool BearWare.TeamTalk4.SetUserVolume ( int  nUserID,
int  nVolume 
) [inherited]

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:
nUserID The ID of the user whose volume will be changed.
nVolume Must be between BearWare.SoundLevel.SOUND_VOLUME_MIN and BearWare.SoundLevel.SOUND_VOLUME_MAX.
See also:
SetSoundOutputVolume
int BearWare.TeamTalk4.GetUserVolume ( int  nUserID  )  [inherited]

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:
nUserID The ID of the user.
Returns:
A value between BearWare.SoundLevel.SOUND_VOLUME_MIN and BearWare.SoundLevel.SOUND_VOLUME_MAX
bool BearWare.TeamTalk4.SetUserGainLevel ( int  nUserID,
int  nGainLevel 
) [inherited]

Use software to gain a user's volume.

Parameters:
nUserID The ID of the user who should have sound gained.
nGainLevel The gain level for the user. A value from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX
See also:
GetUserGainLevel
SoundLevel.SOUND_GAIN_DEFAULT
int BearWare.TeamTalk4.GetUserGainLevel ( int  nUserID  )  [inherited]

Get the software gain level for a user.

Parameters:
nUserID The ID of the user whose gain level should be retrieved.
See also:
SetUserGainLevel
Returns:
The gain level for the user. A value from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX
bool BearWare.TeamTalk4.SetUserMute ( int  nUserID,
bool  bMute 
) [inherited]

Mute a user.

To stop receiving audio from a user call TeamTalk4.DoUnsubscribe().

Parameters:
nUserID The user ID of the user to mute (or unmute).
bMute TRUE will mute, FALSE will unmute.
See also:
SetSoundOutputMute
bool BearWare.TeamTalk4.SetUserStoppedTalkingDelay ( int  nUserID,
int  nDelayMSec 
) [inherited]

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

When a user starts talking the TeamTalk4.OnUserTalking() 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 TeamTalk4.SetUserStoppedTalkingDelay().

See also:
GetUserStoppedTalkingDelay
int BearWare.TeamTalk4.GetUserStoppedTalkingDelay ( int  nUserID  )  [inherited]

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

Returns:
The delay in miliseconds. -1 on error.
See also:
SetUserStoppedTalkingDelay
bool BearWare.TeamTalk4.SetUserPosition ( int  nUserID,
float  x,
float  y,
float  z 
) [inherited]

Set the position of a user.

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

Parameters:
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).
bool BearWare.TeamTalk4.GetUserPosition ( int  nUserID,
out float  x,
out float  y,
out float  z 
) [inherited]

Get a user's position.

Parameters:
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).
bool BearWare.TeamTalk4.SetUserStereo ( int  nUserID,
bool  bLeftSpeaker,
bool  bRightSpeaker 
) [inherited]

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

Parameters:
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:
GetUserStereo
bool BearWare.TeamTalk4.GetUserStereo ( int  nUserID,
out bool  lpbLeftSpeaker,
out bool  lpbRightSpeaker 
) [inherited]

Check what speaker a user is outputting to.

Parameters:
nUserID ID of user.
lpbLeftSpeaker TRUE if playing in left speaker.
lpbRightSpeaker TRUE if playing in right speaker.
See also:
SetUserStereo
bool BearWare.TeamTalk4.SetUserAudioFolder ( int  nUserID,
string  szFolderPath,
string  szFileNameVars,
AudioFileFormat  uAFF 
) [inherited]

Store audio conversations to disk.

Set the path of where to store audio from a channel 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 AudioFileFormat.AFF_NONE.

To store audio of other channels than the client instance check out the section Spying on Users.

Parameters:
nUserID The ID of the BearWare.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 BearWare.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 AudioFileFormat.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 AudioFileFormat.AFF_NONE will cancel/reset the current recording.
Returns:
FALSE if path is invalid, otherwise TRUE.
See also:
BearWare.User
OnUserAudioFile
bool BearWare.TeamTalk4.AcquireUserAudioBlock ( int  nUserID,
ref AudioBlock  lpAudioBlock 
) [inherited]

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

To enable access to user's raw audio first call TeamTalk4.EnableAudioBlockEvent(). Whenever new audio becomes available the event TeamTalk4.OnUserAudioBlock() is generated and TeamTalk4.AcquireUserAudioBlock() can be called to extract the audio.

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

If TeamTalk4.AcquireUserAudioBlock() is called multiple times without calling TeamTalk4.ReleaseUserAudioBlock() then the same BearWare.AudioBlock will be retrieved again.

See also:
TeamTalk4.ReleaseUserAudioBlock()
TeamTalk4.EnableAudioBlockEvent()
TeamTalk4.OnUserAudioBlock()
bool BearWare.TeamTalk4.ReleaseUserAudioBlock ( int  nUserID  )  [inherited]

Release the shared memory of an BearWare.AudioBlock.

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

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

See also:
TeamTalk4.AcquireUserAudioBlock()
TeamTalk4.OnUserAudioBlock()
bool BearWare.TeamTalk4.ReleaseAllUserAudioBlocks (  )  [inherited]

Release all audio blocks of the local client instance.

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

See also:
TeamTalk4.ReleaseUserAudioBlock()
TeamTalk4.OnUserAudioBlock()
Generated on Sun Mar 18 17:16:14 2012 for TeamTalk 4 .NET DLL by  doxygen 1.6.3