TeamTalk 4 .NET DLL
Version 4.5A
|
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...
Enumerations | |
enum | BearWare.TransmitType : uint { BearWare.TRANSMIT_NONE = 0x0, BearWare.TRANSMIT_AUDIO = 0x1, BearWare.TRANSMIT_VIDEO = 0x2 } |
Enum specifying data transmission types. More... | |
Functions | |
bool | BearWare.TeamTalk4.EnableVoiceActivation (bool bEnable) |
Enable voice activation. More... | |
bool | BearWare.TeamTalk4.SetVoiceActivationLevel (int nLevel) |
Set voice activation level. More... | |
int | BearWare.TeamTalk4.GetVoiceActivationLevel () |
Get voice activation level. More... | |
bool | BearWare.TeamTalk4.SetVoiceActivationStopDelay (int nDelayMSec) |
Set the delay of when voice activation should be stopped. More... | |
int | BearWare.TeamTalk4.GetVoiceActivationStopDelay () |
Get the delay of when voice active state should be disabled. More... | |
bool | BearWare.TeamTalk4.StartRecordingMuxedAudioFile (AudioCodec lpAudioCodec, string szAudioFileName, AudioFileFormat uAFF) |
Store audio conversations to a single file. More... | |
bool | BearWare.TeamTalk4.StopRecordingMuxedAudioFile () |
Stop an active muxed audio recording. More... | |
bool | BearWare.TeamTalk4.EnableTransmission (TransmitType uTxType, bool bEnable) |
Start/stop transmitting audio or video data. More... | |
bool | BearWare.TeamTalk4.IsTransmitting (TransmitType uTxType) |
Check if the client instance is currently transmitting. More... | |
bool | BearWare.TeamTalk4.StartStreamingAudioFileToUser (int nUserID, string szAudioFilePath) |
Stream a wave-file to a user in another channel. Only an administrators can use this function. More... | |
bool | BearWare.TeamTalk4.StopStreamingAudioFileToUser (int nUserID) |
Stop transmitting audio file. More... | |
bool | BearWare.TeamTalk4.StartStreamingAudioFileToChannel (int nChannelID, string szAudioFilePath) |
Stream audio file to current channel. More... | |
bool | BearWare.TeamTalk4.StopStreamingAudioFileToChannel (int nChannelID) |
Stop streaming audio file to current channel. More... | |
bool | BearWare.TeamTalk4.StartStreamingMediaFileToChannel (string szMediaFilePath, VideoCodec lpVideoCodec, TransmitType uTxType) |
Stream media file to channel, e.g. avi-, wav- or MP3-file. More... | |
bool | BearWare.TeamTalk4.StopStreamingMediaFileToChannel () |
Stop streaming media file to channel. More... | |
static bool | BearWare.TeamTalk4.GetMediaFileInfo (string szMediaFilePath, out MediaFileInfo pMediaFileInfo) |
Get the properties of a media file. More... | |
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 ClientFlag CLIENT_SNDINPUT_READY enabled which is done in the function TeamTalk4.InitSoundInputDevice(). To transmit video requires the flag ClientFlag CLIENT_VIDEO_READY which is enabled by the function TeamTalk4.InitVideoCaptureDevice(). To hear what others users are saying a sound output device must have been configured using TeamTalk4.InitSoundOutputDevice() and thereby have enabled the flag ClientFlag CLIENT_SNDOUTPUT_READY.
Calling TeamTalk4.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 TeamTalk4.EnableVoiceActivation() and setting a voice activation level using TeamTalk4.SetVoiceActivationLevel().
enum BearWare.TransmitType : uint |
bool BearWare.TeamTalk4.EnableVoiceActivation | ( | 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 SetVoiceActivationLevel. Once the voice activation level is reached the event OnVoiceActivation is posted.
The current volume level can be queried calling GetSoundInputLevel.
bEnable | TRUE to enable, otherwise FALSE. |
bool BearWare.TeamTalk4.SetVoiceActivationLevel | ( | int | nLevel | ) |
Set voice activation level.
The current volume level can be queried calling GetSoundInputLevel().
nLevel | Must be between BearWare.SoundLevel.SOUND_VU_MIN and BearWare.SoundLevel.SOUND_VU_MAX |
int BearWare.TeamTalk4.GetVoiceActivationLevel | ( | ) |
Get voice activation level.
bool BearWare.TeamTalk4.SetVoiceActivationStopDelay | ( | int | nDelayMSec | ) |
Set the delay of when voice activation should be stopped.
When TeamTalk4.GetSoundInputLevel() becomes higher than the specified voice activation level the client instance will start transmitting until TeamTalk4.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 TeamTalk4.SetVoiceActivationStopDelay().
int BearWare.TeamTalk4.GetVoiceActivationStopDelay | ( | ) |
Get the delay of when voice active state should be disabled.
bool BearWare.TeamTalk4.StartRecordingMuxedAudioFile | ( | AudioCodec | lpAudioCodec, |
string | szAudioFileName, | ||
AudioFileFormat | uAFF | ||
) |
Store audio conversations to a single file.
Unlike TeamTalk4.SetUserAudioFolder(), which stores users' audio streams in separate files, TeamTalk4.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 BearWare.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 TeamTalk4.StartRecordingMuxedAudioFile() will enable the ClientFlag CLIENT_MUX_AUDIOFILE flag from TeamTalk4.GetFlags().
Call TeamTalk4.StopRecordingMuxedAudioFile() to stop recording. Note that only one muxed audio recording can be active at the same time.
lpAudioCodec | The audio codec which should be used as reference for muxing users' audio streams. In most situations this is the BearWare.AudioCodec of the current channel, i.e. TeamTalk4.GetMyChannelID(). |
szAudioFileName | The file to store audio to, e.g. C:\MyFiles\Conf.mp3. |
uAFF | The audio format which should be used in the recorded file. The muxer will convert to this format. |
bool BearWare.TeamTalk4.StopRecordingMuxedAudioFile | ( | ) |
Stop an active muxed audio recording.
A muxed audio recording started with TeamTalk4.StartRecordingMuxedAudioFile() can be stopped using this function.
Calling TeamTalk4.StopRecordingMuxedAudioFile() will clear the ClientFlag CLIENT_MUX_AUDIOFILE flag from TeamTalk4.GetFlags().
bool BearWare.TeamTalk4.EnableTransmission | ( | TransmitType | uTxType, |
bool | bEnable | ||
) |
Start/stop transmitting audio or video data.
To check if transmission of either audio or video is enabled call GetFlags and check bits ClientFlag CLIENT_TX_AUDIO and ClientFlag CLIENT_TX_VIDEO.
uTxType | A bitmask of the data types to enable/disable transmission of. |
bEnable | Enable/disable transmission of bits in mask. |
bool BearWare.TeamTalk4.IsTransmitting | ( | TransmitType | uTxType | ) |
Check if the client instance is currently transmitting.
This call also checks if transmission is ongoing due to voice activation.
uTxType | A bitmask specifying whether the client instance is currently transmitting the given TransmitType. |
bool BearWare.TeamTalk4.StartStreamingAudioFileToUser | ( | int | nUserID, |
string | szAudioFilePath | ||
) |
Stream a wave-file to a user in another channel. Only an administrators can use this function.
The event OnStreamAudioFileUser is called when audio file is started and stopped.
nUserID | The ID of the user to transmit to. The user cannot be in the same channel as the local client instance. |
szAudioFilePath | Path to .wav file. The format of the .wav file must be 16-bit PCM uncompressed. Use Audacity to convert to proper file format. |
bool BearWare.TeamTalk4.StopStreamingAudioFileToUser | ( | int | nUserID | ) |
Stop transmitting audio file.
nUserID | The ID of the user being transmitted to. |
bool BearWare.TeamTalk4.StartStreamingAudioFileToChannel | ( | int | nChannelID, |
string | 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 OnStreamAudioFileChannel is posted when audio file is being processed.
nChannelID | Pass GetMyChannelID(). Transmitting to other channels is currently not supported. |
szAudioFilePath | Path to .wav file. The format of the .wav file must be 16-bit PCM uncompressed. Use Audacity to convert to proper file format. |
bool BearWare.TeamTalk4.StopStreamingAudioFileToChannel | ( | int | nChannelID | ) |
Stop streaming audio file to current channel.
nChannelID | Pass GetMyChannelID(). |
bool BearWare.TeamTalk4.StartStreamingMediaFileToChannel | ( | string | szMediaFilePath, |
VideoCodec | lpVideoCodec, | ||
TransmitType | uTxType | ||
) |
Stream media file to channel, e.g. avi-, wav- or MP3-file.
This function is meant as a replacement for TeamTalk4.StartStreamingAudioFileToChannel() since it can also stream wave-files.
Call TeamTalk4.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 TeamTalk4.EnableTransmission() will have no effect.
The event OnStreamMediaFileToChannel() is called when the media file starts streaming. The flags ClientFlag 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 TeamTalk4.SetUserMediaBufferSize() to change the size of a user's media buffer.
szMediaFilePath | File path to media file. |
lpVideoCodec | If video file then specify output codec properties here. Specify Codec NO_CODEC if video should be ignored. |
uTxType | Specify 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. |
bool BearWare.TeamTalk4.StopStreamingMediaFileToChannel | ( | ) |
Stop streaming media file to channel.
This will clear the flags CLIENT_STREAM_AUDIO and/or CLIENT_STREAM_VIDEO.
|
static |
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.