TeamTalk 4 .NET DLL  Version 4.5A
Client Initialization

The first thing a user application must to is instantiate the TeamTalk4 class. More...

Classes

class  BearWare.TeamTalk4
 The class which encapsulates the TeamTalk 4 client. More...
 

Enumerations

enum  BearWare.ClientFlag : uint {
  BearWare.CLIENT_CLOSED = 0x00000000, BearWare.CLIENT_SNDINPUT_READY = 0x00000001, BearWare.CLIENT_SNDOUTPUT_READY = 0x00000002, BearWare.CLIENT_VIDEO_READY = 0x00000004,
  BearWare.CLIENT_DESKTOP_ACTIVE = 0x00000008, BearWare.CLIENT_SNDINPUT_VOICEACTIVATED = 0x00000010, BearWare.CLIENT_SNDINPUT_DENOISING = 0x00000020, BearWare.CLIENT_SNDINPUT_AGC = 0x00000040,
  BearWare.CLIENT_SNDOUTPUT_MUTE = 0x00000080, BearWare.CLIENT_SNDOUTPUT_AUTO3DPOSITION = 0x00000100, BearWare.CLIENT_SNDINPUT_AEC = 0x00000200, BearWare.CLIENT_SNDINOUTPUT_DUPLEX = 0x00000400,
  BearWare.CLIENT_TX_AUDIO = 0x00001000, BearWare.CLIENT_TX_VIDEO = 0x00002000, BearWare.CLIENT_MUX_AUDIOFILE = 0x00004000, BearWare.CLIENT_TX_DESKTOP = 0x00008000,
  BearWare.CLIENT_CONNECTING = 0x00010000, BearWare.CLIENT_CONNECTED = 0x00020000, BearWare.CLIENT_CONNECTION = CLIENT_CONNECTING | CLIENT_CONNECTED, BearWare.CLIENT_AUTHORIZED = 0x00040000,
  BearWare.CLIENT_P2P_AUDIO = 0x00100000, BearWare.CLIENT_P2P_VIDEO = 0x00200000, BearWare.CLIENT_P2P = CLIENT_P2P_AUDIO | CLIENT_P2P_VIDEO, BearWare.CLIENT_STREAM_AUDIO = 0x00400000,
  BearWare.CLIENT_STREAM_VIDEO = 0x00800000
}
 Flags used to describe the the client instance current state. More...
 

Functions

 BearWare.TeamTalk4.TeamTalk4 (bool poll_based)
 Create a new TeamTalk client instance. More...
 
 BearWare.TeamTalk4.~TeamTalk4 ()
 Close the TeamTalk client instance and release its resources. More...
 
void BearWare.TeamTalk4.Dispose ()
 
void BearWare.TeamTalk4.DeleteMe ()
 
bool BearWare.TeamTalk4.GetMessage (int nWaitMs)
 Poll for events in the client instance. More...
 
BearWare.ClientFlag BearWare.TeamTalk4.GetFlags ()
 Get a bitmask describing the client's current state. More...
 
static bool BearWare.TeamTalk4.SetLicenseInformation (string szRegName, long nRegKey)
 Set license information to disable trial mode. More...
 
void BearWare.TeamTalk4.processMsg (ref TTMessage msg)
 

Variables

const int BearWare.TeamTalk4.TT_STRLEN = 512
 The maximum length of all strings used in TeamTalk. This value includes the zero terminator, so 511 characters. Note that Unicode characters are converted to UTF-8 internally and limited once again to 512 if the string gets longer. More...
 
const int BearWare.TeamTalk4.DEFAULT_TCPPORT = 10333
 
const int BearWare.TeamTalk4.DEFAULT_UDPPORT = 10333
 
const int BearWare.TeamTalk4.DEFAULT_AGC_GAINLEVEL = 8000
 
const int BearWare.TeamTalk4.DEFAULT_AGC_INC_MAXDB = 12
 
const int BearWare.TeamTalk4.DEFAULT_AGC_DEC_MAXDB = -40
 
const int BearWare.TeamTalk4.DEFAULT_AGC_GAINMAXDB = 30
 
const int BearWare.TeamTalk4.DEFAULT_DENOISE_SUPPRESS = -30
 

Properties

ClientFlag BearWare.TeamTalk4.Flags [get]
 Same as GetFlags(). More...
 

Detailed Description

The first thing a user application must to is instantiate the TeamTalk4 class.

The TeamTalk4.TeamTalk4() constructor has the parameter poll_events which should be 'false' for Windows Forms applications and 'true' for console applications. The poll_events parameter tells how the client instance should post its events. Since a Windows Forms application has its own message-loop it does not need to "poll" for events. This is, however, needed by console applications which should call TeamTalk4.GetMessage() to get events.

When a new client instance is created a call to TeamTalk4.GetFlags() will show that the client initially is in state ClientFlag CLIENT_CLOSED. This means that no operation has been performed on the client.

Querying TeamTalk4.GetFlags() call can be used by a user application as a state-machine to show which actions are currently possible for the user application. The ClientFlag enumeration shows the information which can be retrived though TeamTalk4.GetFlags().

Enumeration Type Documentation

enum BearWare.ClientFlag : uint

Flags used to describe the the client instance current state.

The client's state is a bitmask of the flags in ClientFlag.

The state of the client instance can be retrieved by calling TeamTalk4.GetFlags() This enables the user application to display the possible options to the end user. If e.g. the flag ClientFlag CLIENT_AUTHORIZED is not set it will not be possible to perform any other commands except TeamTalk4.DoLogin(). Doing so will make the server return an error message to the client.

Enumerator
CLIENT_CLOSED 

If no bits are set the client instance is in closed state, in other words no operations has been performed on it.

CLIENT_SNDINPUT_READY 

If set the client instance's sound input device has been initialized, i.e. TeamTalk4.InitSoundInputDevice() has been called successfully.

CLIENT_SNDOUTPUT_READY 

If set the client instance's sound output device has been initialized, i.e. TeamTalk4.InitSoundOutputDevice() has been called successfully.

CLIENT_VIDEO_READY 

If set the client instance's video device has been initialized, i.e. TeamTalk4.InitVideoCaptureDevice() has been called successfuly.

CLIENT_DESKTOP_ACTIVE 

If set the client instance current have an active desktop session, i.e. TeamTalk4.SendDesktopWindow() has been called. Call TeamTalk4.CloseDesktopWindow() to close the desktop session.

CLIENT_SNDINPUT_VOICEACTIVATED 

If set the client instance will start transmitting audio if the sound level is above the voice activation level. The event TeamTalk4.OnVoiceActivation() is posted when voice activation initiates transmission.

See Also
TeamTalk4.SetVoiceActivationLevel
TeamTalk4.EnableVoiceActivation
CLIENT_SNDINPUT_DENOISING 

If set the client instance will try to remove noise from recorded audio.

See Also
TeamTalk4.EnableDenoising
CLIENT_SNDINPUT_AGC 

If set the client instance is using automatic gain control.

See Also
TeamTalk4.EnableAGC
CLIENT_SNDOUTPUT_MUTE 

If set the client instance has muted all users.

See Also
TeamTalk4.SetSoundOutputMute
CLIENT_SNDOUTPUT_AUTO3DPOSITION 

If set the client instance will auto position users in a 180 degree circle using 3D-sound. This option is only available with SoundSystem SOUNDSYSTEM_DSOUND.

See Also
TeamTalk4.SetUserPosition
TeamTalk4.Enable3DSoundPositioning
CLIENT_SNDINPUT_AEC 

If set the client instance will try to eliminate echo from speakers. To enable echo cancellation first make the client run on sound duplex mode by calling TeamTalk4.InitSoundDuplexDevices() and afterwards call TeamTalk4.EnableEchoCancellation().

CLIENT_SNDINOUTPUT_DUPLEX 

If set the client instance is running in sound duplex mode where multiple audio output streams are mixed into a single stream. This option must be enabled to support echo cancellation (ClientFlag CLIENT_SNDINPUT_AEC). Call TeamTalk4.InitSoundDuplexDevices() to enable duplex mode.

CLIENT_TX_AUDIO 

If set the client instance is currently transmitting audio.

See Also
TeamTalk4.EnableTransmission
CLIENT_TX_VIDEO 

If set the client instance is currently transmitting video.

See Also
TeamTalk4.EnableTransmission
CLIENT_MUX_AUDIOFILE 

If set the client instance is currently muxing audio streams into a single file. This is enabled by calling TeamTalk4.StartRecordingMuxedAudioFile().

CLIENT_TX_DESKTOP 

If set the client instance is currently transmitting a desktop window. A desktop window update is issued by calling TeamTalk4.SendDesktopWindow(). The event OnDesktopTransferUpdate() is triggered when a desktop window transmission completes.

CLIENT_CONNECTING 

If set the client instance is currently try to connect to a server, i.e. TeamTalk4.Connect() has been called.

CLIENT_CONNECTED 

If set the client instance is connected to a server, i.e. TeamTalk4.OnConnectSuccess() event has been issued after doing a TeamTalk4.Connect(). Valid commands in this state: TeamTalk4.DoLogin()

CLIENT_CONNECTION 

Helper for ClientFlag CLIENT_CONNECTING and ClientFlag CLIENT_CONNECTED to see if TeamTalk4.Disconnect() should be called.

CLIENT_AUTHORIZED 

If set the client instance is logged on to a server, i.e. got TeamTalk4.OnCmdMyselfLoggedIn() event after issueing TeamTalk4.DoLogin().

CLIENT_P2P_AUDIO 

If set the client instance will try and connect to other users using peer to peer connections. Audio will be broadcast to users instead of forwarded through server (thereby increasing the bandwith usage). Note that if UserRight USERRIGHT_FORWARD_AUDIO is disabled and no peer to peer connection could be established, i.e. event TeamTalk4.OnConnectionP2P() was posted with failure, then data cannot be transferred to a user.

CLIENT_P2P_VIDEO 

If set the client instance will try and connect to other users using peer to peer connections. Video will be broadcast to users instead of forwarded through server (thereby increasing the bandwith usage). Note that if UserRight USERRIGHT_FORWARD_VIDEO is disabled and no peer to peer connection could be established, i.e. event TeamTalk4.OnConnectionP2P() was posted with failure, then data cannot be transferred to a user.

CLIENT_P2P 

Helper for ClientFlag CLIENT_P2P_AUDIO and ClientFlag CLIENT_P2P_VIDEO to see if the client instance is currently attempting P2P connections.

CLIENT_STREAM_AUDIO 

If set the client is currently streaming the audio of a media file. When streaming a video file the CLIENT_STREAM_VIDEO flag is also typically set.

See Also
TeamTalk4.StartStreamingMediaFileToChannel()
CLIENT_STREAM_VIDEO 

If set the client is currently streaming the video *of a media file. When streaming a video file the CLIENT_STREAM_AUDIO flag is also typically set.

See Also
TeamTalk4.StartStreamingMediaFileToChannel()

Function Documentation

BearWare.TeamTalk4.TeamTalk4 ( bool  poll_based)

Create a new TeamTalk client instance.

Parameters
poll_basedIf the application using this class is a Windows Forms application poll_based should be 'false' since events will be posted using the Windows message loop. In Console applications on the other hand, the user application will have to 'poll' for events using GetMessage(). Remember to put the [STAThread] macro on the Main method if building a console application.
BearWare.TeamTalk4.~TeamTalk4 ( )
private

Close the TeamTalk client instance and release its resources.

void BearWare.TeamTalk4.Dispose ( )
void BearWare.TeamTalk4.DeleteMe ( )
private
bool BearWare.TeamTalk4.GetMessage ( int  nWaitMs)

Poll for events in the client instance.

In a Windows Forms application events can be processed using the application message-loop, but in Console application the application must process the events itself. The most common way to do this is to start a timer which calls GetMessage every now and then to ensure the UI is updated with the latest events.

Parameters
nWaitMsThe amount of time to wait for the event. If -1 the function will block forever or until the next event occurs.
Returns
Returns TRUE if an event has occured otherwise FALSE.
See Also
TeamTalk4()
ClientEvent
BearWare.ClientFlag BearWare.TeamTalk4.GetFlags ( )

Get a bitmask describing the client's current state.

Checks whether the client is connecting, connected, authorized, etc. The current state can be checked by and'ing the returned bitmask which is based on ClientFlag.

Returns
A bitmask describing the current state.
static bool BearWare.TeamTalk4.SetLicenseInformation ( string  szRegName,
long  nRegKey 
)
static

Set license information to disable trial mode.

This function must be called before instantiating the TeamTalk4-class.

Parameters
szRegNameThe registration name provided by BearWare.dk.
nRegKeyThe registration key provided by BearWare.dk.
Returns
True if the provided registration is acceptable.
void BearWare.TeamTalk4.processMsg ( ref TTMessage  msg)

Variable Documentation

const int BearWare.TeamTalk4.TT_STRLEN = 512

The maximum length of all strings used in TeamTalk. This value includes the zero terminator, so 511 characters. Note that Unicode characters are converted to UTF-8 internally and limited once again to 512 if the string gets longer.

const int BearWare.TeamTalk4.DEFAULT_TCPPORT = 10333
const int BearWare.TeamTalk4.DEFAULT_UDPPORT = 10333
const int BearWare.TeamTalk4.DEFAULT_AGC_GAINLEVEL = 8000
const int BearWare.TeamTalk4.DEFAULT_AGC_INC_MAXDB = 12
const int BearWare.TeamTalk4.DEFAULT_AGC_DEC_MAXDB = -40
const int BearWare.TeamTalk4.DEFAULT_AGC_GAINMAXDB = 30
const int BearWare.TeamTalk4.DEFAULT_DENOISE_SUPPRESS = -30

Properties

ClientFlag BearWare.TeamTalk4.Flags
get

Same as GetFlags().