TeamTalk 4 C-API DLL  Version 4.5A
Audio and Video Transmission

Once the client instance has joined a channel it can transmit audio and video to other users in the channel. When transmitting audio and video it is important to be aware of how the client is configured to do this. Sections Forward Through Server Transmission Mode and Peer to Peer Transmission Mode explains the two supported data transmission modes. More...

Typedefs

typedef enum TransmitType TransmitType
 Enum specifying data transmission types. More...
 
typedef UINT32 TransmitTypes
 A mask of data transmissions based on TransmitType. More...
 

Enumerations

enum  TransmitType { TRANSMIT_NONE = 0x0, TRANSMIT_AUDIO = 0x1, TRANSMIT_VIDEO = 0x2 }
 Enum specifying data transmission types. More...
 

Functions

TEAMTALKDLL_API BOOL TT_EnableVoiceActivation (IN TTInstance *lpTTInstance, IN BOOL bEnable)
 Enable voice activation. More...
 
TEAMTALKDLL_API BOOL TT_SetVoiceActivationLevel (IN TTInstance *lpTTInstance, IN INT32 nLevel)
 Set voice activation level. More...
 
TEAMTALKDLL_API INT32 TT_GetVoiceActivationLevel (IN TTInstance *lpTTInstance)
 Get voice activation level. More...
 
TEAMTALKDLL_API BOOL TT_SetVoiceActivationStopDelay (IN TTInstance *lpTTInstance, IN INT32 nDelayMSec)
 Set the delay of when voice activation should be stopped. More...
 
TEAMTALKDLL_API INT32 TT_GetVoiceActivationStopDelay (IN TTInstance *lpTTInstance)
 Get the delay of when voice active state should be disabled. More...
 
TEAMTALKDLL_API BOOL TT_StartRecordingMuxedAudioFile (IN TTInstance *lpTTInstance, IN const AudioCodec *lpAudioCodec, IN const TTCHAR *szAudioFileName, IN AudioFileFormat uAFF)
 Store audio conversations to a single file. More...
 
TEAMTALKDLL_API BOOL TT_StopRecordingMuxedAudioFile (IN TTInstance *lpTTInstance)
 Stop an active muxed audio recording. More...
 
TEAMTALKDLL_API BOOL TT_EnableTransmission (IN TTInstance *lpTTInstance, IN TransmitTypes uTxType, IN BOOL bEnable)
 Start/stop transmitting audio or video data. More...
 
TEAMTALKDLL_API BOOL TT_IsTransmitting (IN TTInstance *lpTTInstance, IN TransmitTypes uTxType)
 Check if the client instance is currently transmitting. More...
 
TEAMTALKDLL_API BOOL TT_StartStreamingAudioFileToUser (IN TTInstance *lpTTInstance, IN INT32 nUserID, IN const TTCHAR *szAudioFilePath)
 Stream a wave-file to a user in another channel. Only an administrators can use this function. More...
 
TEAMTALKDLL_API BOOL TT_StopStreamingAudioFileToUser (IN TTInstance *lpTTInstance, IN INT32 nUserID)
 Stop transmitting audio file. More...
 
TEAMTALKDLL_API BOOL TT_StartStreamingAudioFileToChannel (IN TTInstance *lpTTInstance, IN INT32 nChannelID, IN const TTCHAR *szAudioFilePath)
 Stream audio file to current channel. More...
 
TEAMTALKDLL_API BOOL TT_StopStreamingAudioFileToChannel (IN TTInstance *lpTTInstance, IN INT32 nChannelID)
 Stop streaming audio file to current channel. More...
 
TEAMTALKDLL_API BOOL TT_StartStreamingMediaFileToChannel (IN TTInstance *lpTTInstance, IN const TTCHAR *szMediaFilePath, IN const VideoCodec *lpVideoCodec, IN TransmitTypes uTxType)
 Stream media file to channel, e.g. avi-, wav- or MP3-file. More...
 
TEAMTALKDLL_API BOOL TT_StopStreamingMediaFileToChannel (IN TTInstance *lpTTInstance)
 Stop streaming media file to channel. More...
 
TEAMTALKDLL_API BOOL TT_GetMediaFileInfo (IN const TTCHAR *szMediaFilePath, OUT MediaFileInfo *pMediaFileInfo)
 Get the properties of a media file. More...
 

Detailed Description

Once the client instance has joined a channel it can transmit audio and video to other users in the channel. When transmitting audio and video it is important to be aware of how the client is configured to do this. Sections Forward Through Server Transmission Mode and Peer to Peer Transmission Mode explains the two supported data transmission modes.

To transmit audio the client must have the flag CLIENT_SNDINPUT_READY enabled which is done in the function TT_InitSoundInputDevice. To transmit video requires the flag CLIENT_VIDEO_READY which is enabled by the function TT_InitVideoCaptureDevice. To hear what others users are saying a sound output device must have been configured using TT_InitSoundOutputDevice and thereby have enabled the flag CLIENT_SNDOUTPUT_READY.

Calling TT_EnableTransmission will make the client instance start transmitting either audio or video data. Note that audio transmission can also be activated automatically using voice activation. This is done by called TT_EnableVoiceActivation and setting a voice activation level using TT_SetVoiceActivationLevel.

Typedef Documentation

typedef enum TransmitType TransmitType

Enum specifying data transmission types.

See Also
TT_EnableTransmission
TT_IsTransmitting
typedef UINT32 TransmitTypes

A mask of data transmissions based on TransmitType.

See Also
TT_EnableTransmission

Enumeration Type Documentation

Enum specifying data transmission types.

See Also
TT_EnableTransmission
TT_IsTransmitting
Enumerator
TRANSMIT_NONE 

Transmitting nothing.

TRANSMIT_AUDIO 

Transmit audio.

TRANSMIT_VIDEO 

Transmit video.

Function Documentation

TEAMTALKDLL_API BOOL TT_EnableVoiceActivation ( IN TTInstance lpTTInstance,
IN BOOL  bEnable 
)

Enable voice activation.

The client instance will start transmitting audio if the recorded audio level is above or equal to the voice activation level set by TT_SetVoiceActivationLevel. Once the voice activation level is reached the event WM_TEAMTALK_VOICE_ACTIVATION is posted.

The current volume level can be queried calling TT_GetSoundInputLevel.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
bEnableTRUE to enable, otherwise FALSE.
See Also
CLIENT_SNDINPUT_VOICEACTIVATION
TT_SetVoiceActivationStopDelay
TEAMTALKDLL_API BOOL TT_SetVoiceActivationLevel ( IN TTInstance lpTTInstance,
IN INT32  nLevel 
)

Set voice activation level.

The current volume level can be queried calling TT_GetSoundInputLevel.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nLevelMust be between SOUND_VU_MIN and SOUND_VU_MAX
See Also
TT_EnableVoiceActivation
TT_GetVoiceActivationLevel
TT_SetVoiceActivationStopDelay
TEAMTALKDLL_API INT32 TT_GetVoiceActivationLevel ( IN TTInstance lpTTInstance)

Get voice activation level.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
Returns
Returns A value between SOUND_VU_MIN and SOUND_VU_MAX
See Also
TT_EnableVoiceActivation
TT_SetVoiceActivationLevel
TEAMTALKDLL_API BOOL TT_SetVoiceActivationStopDelay ( IN TTInstance lpTTInstance,
IN INT32  nDelayMSec 
)

Set the delay of when voice activation should be stopped.

When TT_GetSoundInputLevel() becomes higher than the specified voice activation level the client instance will start transmitting until TT_GetSoundInputLevel() becomes lower than the voice activation level, plus a delay. This delay is by default set to 1500 msec but this value can be changed by calling TT_SetVoiceActivationStopDelay().

See Also
TT_EnableVoiceActivation
TT_SetVoiceActivationLevel
TEAMTALKDLL_API INT32 TT_GetVoiceActivationStopDelay ( IN TTInstance lpTTInstance)

Get the delay of when voice active state should be disabled.

Returns
The number of miliseconds before voice activated state should be turned back to inactive.
See Also
TT_SetVoiceActivationStopDelay
TT_EnableVoiceActivation
TT_SetVoiceActivationLevel
TEAMTALKDLL_API BOOL TT_StartRecordingMuxedAudioFile ( IN TTInstance lpTTInstance,
IN const AudioCodec lpAudioCodec,
IN const TTCHAR szAudioFileName,
IN AudioFileFormat  uAFF 
)

Store audio conversations to a single file.

Unlike TT_SetUserAudioFolder(), which stores users' audio streams in separate files, TT_StartRecordingMuxedAudioFile() muxes the audio streams into a single file.

The audio streams, which should be muxed together, are required to use the same audio codec. In most cases this is the audio codec of the channel where the user is currently participating (i.e. codec member of Channel).

If the user changes to a channel which uses a different audio codec then the recording will continue but simply be silent until the user again joins a channel with the same audio codec as was used for initializing muxed audio recording.

Calling TT_StartRecordingMuxedAudioFile() will enable the CLIENT_MUX_AUDIOFILE flag from TT_GetFlags().

Call TT_StopRecordingMuxedAudioFile() to stop recording. Note that only one muxed audio recording can be active at the same time.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
lpAudioCodecThe audio codec which should be used as reference for muxing users' audio streams. In most situations this is the AudioCodec of the current channel, i.e. TT_GetMyChannelID().
szAudioFileNameThe file to store audio to, e.g. C:\MyFiles\Conf.mp3.
uAFFThe audio format which should be used in the recorded file. The muxer will convert to this format.
See Also
TT_SetUserAudioFolder()
TT_StopRecordingMuxedAudioFile()
TEAMTALKDLL_API BOOL TT_StopRecordingMuxedAudioFile ( IN TTInstance lpTTInstance)

Stop an active muxed audio recording.

A muxed audio recording started with TT_StartRecordingMuxedAudioFile() can be stopped using this function.

Calling TT_StopRecordingMuxedAudioFile() will clear the CLIENT_MUX_AUDIOFILE flag from TT_GetFlags().

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
See Also
TT_StartRecordingMuxedAudioFile()
TEAMTALKDLL_API BOOL TT_EnableTransmission ( IN TTInstance lpTTInstance,
IN TransmitTypes  uTxType,
IN BOOL  bEnable 
)

Start/stop transmitting audio or video data.

To check if transmission of either audio or video is enabled call TT_GetFlags and check bits CLIENT_TX_AUDIO and CLIENT_TX_VIDEO.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
uTxTypeA bitmask of the data types to enable/disable transmission of.
bEnableEnable/disable transmission of bits in mask.
TEAMTALKDLL_API BOOL TT_IsTransmitting ( IN TTInstance lpTTInstance,
IN TransmitTypes  uTxType 
)

Check if the client instance is currently transmitting.

This call also checks if transmission is ongoing due to voice activation.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
uTxTypeA mask specifying whether the client instance is currently transmitting the given TransmitType.
See Also
TT_EnableTransmission
TT_EnableVoiceActivation
TEAMTALKDLL_API BOOL TT_StartStreamingAudioFileToUser ( IN TTInstance lpTTInstance,
IN INT32  nUserID,
IN const TTCHAR szAudioFilePath 
)

Stream a wave-file to a user in another channel. Only an administrators can use this function.

The event WM_TEAMTALK_STREAM_AUDIOFILE_USER is called when audio file is started and stopped.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nUserIDThe ID of the user to transmit to. The user cannot be in the same channel as the local client instance.
szAudioFilePathPath to .wav file. The format of the .wav file must be 16-bit PCM uncompressed. Use Audacity to convert to proper file format.
See Also
TT_StopStreamingAudioFileToUser
TEAMTALKDLL_API BOOL TT_StopStreamingAudioFileToUser ( IN TTInstance lpTTInstance,
IN INT32  nUserID 
)

Stop transmitting audio file.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nUserIDThe ID of the user being transmitted to.
See Also
TT_StartStreamingAudioFileToUser
TEAMTALKDLL_API BOOL TT_StartStreamingAudioFileToChannel ( IN TTInstance lpTTInstance,
IN INT32  nChannelID,
IN const TTCHAR szAudioFilePath 
)

Stream audio file to current channel.

Currently it is only possible to stream to the channel which the local client instance is participating in.

When streaming to the current channel it basically replaces the microphone input with a .wav file. Note that it is not possible to stream a .wav file to a single user in the current channel.

The event WM_TEAMTALK_STREAM_AUDIOFILE_CHANNEL is posted when audio file is being processed.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nChannelIDPass TT_GetMyChannelID. Transmitting to other channels is currently not supported.
szAudioFilePathPath to .wav file. The format of the .wav file must be 16-bit PCM uncompressed. Use Audacity to convert to proper file format.
See Also
TT_StartStreamingAudioFileToUser
TT_StopStreamingAudioFileToChannel
TEAMTALKDLL_API BOOL TT_StopStreamingAudioFileToChannel ( IN TTInstance lpTTInstance,
IN INT32  nChannelID 
)

Stop streaming audio file to current channel.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
nChannelIDPass TT_GetMyChannelID.
TEAMTALKDLL_API BOOL TT_StartStreamingMediaFileToChannel ( IN TTInstance lpTTInstance,
IN const TTCHAR szMediaFilePath,
IN const VideoCodec lpVideoCodec,
IN TransmitTypes  uTxType 
)

Stream media file to channel, e.g. avi-, wav- or MP3-file.

This function is meant as a replacement for TT_StartStreamingAudioFileToChannel() since it can also stream wave-files.

Call TT_GetMediaFileInfo() to get the properties of a media file, i.e. audio and video format.

When a media file is being streamed it will replace the microphone and video input. Therefore calling TT_EnableTransmission() will have no effect.

The event WM_TEAMTALK_STREAM_MEDIAFILE_CHANNEL is called when the media file starts streaming. The flags CLIENT_STREAM_AUDIO and/or CLIENT_STREAM_VIDEO will be set if the call is successful.

It is important for the users who are receiving the streamed media file to increase their media playback buffer. This is because a streamed media file will generate bigger chunks of data unlike microphone and video capture devices which run in realtime. Use TT_SetUserMediaBufferSize() to change the size of a user's media buffer.

Parameters
lpTTInstancePointer to client instance created by TT_InitTeamTalk.
szMediaFilePathFile path to media file.
lpVideoCodecIf video file then specify output codec properties here, otherwise NULL.
uTxTypeSpecify whether audio, video or both should be streamed to channel. If TRANSMIT_AUDIO is specified then the flag CLIENT_STREAM_AUDIO will be set. If TRANSMIT_VIDEO is specified then the flag CLIENT_STREAM_VIDEO is set.
See Also
TT_StopStreamingMediaFileToChannel()
TEAMTALKDLL_API BOOL TT_StopStreamingMediaFileToChannel ( IN TTInstance lpTTInstance)

Stop streaming media file to channel.

This will clear the flags CLIENT_STREAM_AUDIO and/or CLIENT_STREAM_VIDEO.

See Also
TT_StartStreamingMediaFileToChannel()
TEAMTALKDLL_API BOOL TT_GetMediaFileInfo ( IN const TTCHAR szMediaFilePath,
OUT MediaFileInfo pMediaFileInfo 
)

Get the properties of a media file.

Use this function to determine the audio and video properties of a media file, so the user knows what can be streamed.

See Also
TT_StartStreamingMediaFileToChannel()