TeamTalk 5 .NET DLL  Version 5.14A
Audio and Video Transmission

This section explains how to transmit audio and video to users in a channel. More...

Enumerations

enum class  BearWare.StreamType : uint {
  BearWare.STREAMTYPE_NONE = 0x00000000 , BearWare.STREAMTYPE_VOICE = 0x00000001 , BearWare.STREAMTYPE_VIDEOCAPTURE = 0x00000002 , BearWare.STREAMTYPE_MEDIAFILE_AUDIO = 0x00000004 ,
  BearWare.STREAMTYPE_MEDIAFILE_VIDEO = 0x00000008 , BearWare.STREAMTYPE_DESKTOP = 0x00000010 , BearWare.STREAMTYPE_DESKTOPINPUT = 0x00000020 , BearWare.STREAMTYPE_MEDIAFILE ,
  BearWare.STREAMTYPE_CHANNELMSG = 0x00000040 , BearWare.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO = 0x00000080 , BearWare.STREAMTYPE_CLASSROOM_ALL
}
 The types of streams which are available for transmission. More...
 

Functions

bool BearWare.TeamTalkBase.InsertAudioBlock (AudioBlock lpAudioBlock)
 Transmit application provided raw audio in BearWare.AudioBlock-structs as StreamType.STREAMTYPE_VOICE, i.e. microphone input. More...
 
bool BearWare.TeamTalkBase.EnableVoiceTransmission (bool bEnable)
 Start/stop transmitting of voice data from sound input. More...
 
bool BearWare.TeamTalkBase.EnableVoiceActivation (bool bEnable)
 Enable voice activation. More...
 
bool BearWare.TeamTalkBase.SetVoiceActivationLevel (int nLevel)
 Set voice activation level. More...
 
int BearWare.TeamTalkBase.GetVoiceActivationLevel ()
 Get voice activation level. More...
 
bool BearWare.TeamTalkBase.SetVoiceActivationStopDelay (int nDelayMSec)
 Set the delay of when voice activation should be stopped. More...
 
int BearWare.TeamTalkBase.GetVoiceActivationStopDelay ()
 Get the delay of when voice active state should be disabled. More...
 
bool BearWare.TeamTalkBase.StartRecordingMuxedAudioFile (AudioCodec lpAudioCodec, string szAudioFileName, AudioFileFormat uAFF)
 Store all audio conversations with specific BearWare.AudioCodec settings to a single file. More...
 
bool BearWare.TeamTalkBase.StartRecordingMuxedAudioFile (int nChannelID, string szAudioFileName, AudioFileFormat uAFF)
 Store audio conversations from a specific channel into a single file. More...
 
bool BearWare.TeamTalkBase.StartRecordingMuxedStreams (StreamType uStreamTypes, AudioCodec lpAudioCodec, string szAudioFileName, AudioFileFormat uAFF)
 Mix multiple BearWare.StreamType into a single audio file. More...
 
bool BearWare.TeamTalkBase.StopRecordingMuxedAudioFile ()
 Stop an active muxed audio recording. More...
 
bool BearWare.TeamTalkBase.StopRecordingMuxedAudioFile (int nChannelID)
 Stop recording conversations from a channel to a single file. More...
 
bool BearWare.TeamTalkBase.StartVideoCaptureTransmission (VideoCodec lpVideoCodec)
 Start transmitting from video capture device. More...
 
bool BearWare.TeamTalkBase.StopVideoCaptureTransmission ()
 Stop transmitting from video capture device. More...
 

Detailed Description

This section explains how to transmit audio and video to users in a channel.

Once the client instance has joined a channel it can transmit audio, video and desktops to other users in the channel.

To transmit audio the client must have the flag ClientFlag ClientFlag.CLIENT_SNDINPUT_READY enabled which is done in the function TeamTalkBase.InitSoundInputDevice(). To transmit video requires the flag ClientFlag ClientFlag.CLIENT_VIDEOCAPTURE_READY which is enabled by the function TeamTalkBase.InitVideoCaptureDevice(). To hear what others users are saying a sound output device must have been configured using TeamTalkBase.InitSoundOutputDevice() and thereby have enabled the flag ClientFlag ClientFlag.CLIENT_SNDOUTPUT_READY.

Calling TeamTalkBase.EnableVoiceTransmission() will make the client instance start transmitting voice data. Voice transmission can also be activated automatically using voice activation. This is done by called TeamTalkBase.EnableVoiceActivation() and setting a voice activation level using TeamTalkBase.SetVoiceActivationLevel(). Note that voice transmission requires UserRight.USERRIGHT_TRANSMIT_VOICE.

Calling TeamTalkBase.StartVideoCaptureTransmission() will make the client instance start transmission video data from a video capture device (typically a webcam). Note that video capture transmission requires UserRight.USERRIGHT_TRANSMIT_VIDEOCAPTURE.

Enumeration Type Documentation

◆ StreamType

enum BearWare.StreamType : uint
strong

The types of streams which are available for transmission.

Enumerator
STREAMTYPE_NONE 

No stream.

STREAMTYPE_VOICE 

Voice stream type which is audio recorded from a sound input device.

See also
TeamTalkBase.InitSoundInputDevice()
STREAMTYPE_VIDEOCAPTURE 

Video capture stream type which is video recorded from a webcam.

See also
TeamTalkBase.InitVideoCaptureDevice()
STREAMTYPE_MEDIAFILE_AUDIO 

Audio stream type from a media file which is being streamed.

See also
TeamTalkBase.StartStreamingMediaFileToChannel()
STREAMTYPE_MEDIAFILE_VIDEO 

Video stream type from a media file which is being streamed.

See also
TeamTalkBase.StartStreamingMediaFileToChannel()
STREAMTYPE_DESKTOP 

Desktop window stream type which is a window (or bitmap) being transmitted.

See also
TeamTalkBase.SendDesktopWindow()
STREAMTYPE_DESKTOPINPUT 

Desktop input stream type which is keyboard or mouse input being transmitted.

See also
TeamTalkBase.SendDesktopInput()
STREAMTYPE_MEDIAFILE 

Shortcut to allow both audio and video media files.

STREAMTYPE_CHANNELMSG 

Channel text messages as stream type.

   A channel text message is not a stream but is only included
   as a stream type in order to be able to block messages
   using @c transmitUsers in #BearWare.Channel struct.

   @see TeamTalkBase.DoUpdateChannel()  
   @see ChannelType.CHANNEL_CLASSROOM. 
STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO 

Stream type for audio of local playback.

    TeamTalkBase.EnableAudioBlockEvent() can be used to intercept audio
    from a local media playback.
    @see TeamTalkBase.InitLocalPlayback() 
STREAMTYPE_CLASSROOM_ALL 

Shortcut to allow voice, media files, desktop, webcamera and channel messages.

Definition at line 44 of file TeamTalk.cs.

Function Documentation

◆ InsertAudioBlock()

bool BearWare.TeamTalkBase.InsertAudioBlock ( AudioBlock  lpAudioBlock)

Transmit application provided raw audio in BearWare.AudioBlock-structs as StreamType.STREAMTYPE_VOICE, i.e. microphone input.

Since StreamType.STREAMTYPE_VOICE is being replaced by audio input this means that while audio input is active then subsequent calls to TeamTalkBase.EnableVoiceTransmission() or TeamTalkBase.EnableVoiceActivation() will fail until the audio input has ended.

If the flags ClientFlag.CLIENT_TX_VOICE or ClientFlag.CLIENT_SNDINPUT_VOICEACTIVATED are active then calling TeamTalkBase.InputAudioBlock() will fail because StreamType.STREAMTYPE_VOICE is already in use.

TeamTalkBase.InsertAudioBlock() can be called multiple times until the client instance's internal queue is full. When the queue has been filled then monitor ClientEvent.CLIENTEVENT_AUDIOINPUT to see when more data can be queued.

To end raw audio input set parameter lpAudioBlock to NULL and then TeamTalkBase.EnableVoiceTransmission() or TeamTalkBase.StartStreamingMediaFileToChannel() will be available again.

Parameters
lpAudioBlockThe audio to submit as audio input. The member nStreamID of BearWare.AudioBlock is used to identify the audio input session which is currently in progress and is posted as the nSource of ClientEvent.CLIENTEVENT_AUDIOINPUT. The member uSampleIndex of BearWare.AudioBlock is ignored.

Definition at line 5395 of file TeamTalk.cs.

◆ EnableVoiceTransmission()

bool BearWare.TeamTalkBase.EnableVoiceTransmission ( bool  bEnable)

Start/stop transmitting of voice data from sound input.

Sound input is initialized using TeamTalkBase.InitSoundInputDevice() or TeamTalkBase.InitSoundDuplexDevices().

Voice transmission is stream type StreamType.STREAMTYPE_VOICE.

User rights required:

Note that voice activation cannot be enabled when TeamTalkBase.InsertAudioBlock() is active.

Parameters
bEnableEnable/disable transmission.
Returns
TRUE on success. FALSE if voice transmission could not be activated on the client instance.

Definition at line 5417 of file TeamTalk.cs.

◆ EnableVoiceActivation()

bool BearWare.TeamTalkBase.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.

Voice transmission is stream type StreamType.STREAMTYPE_VOICE.

User rights required:

Note that voice activation cannot be enabled when TeamTalkBase.InsertAudioBlock() is active.

Parameters
bEnableTRUE to enable, otherwise FALSE.
Returns
TRUE on success. FALSE if voice activation cannot be enabled on the client instance.
See also
ClientFlag.CLIENT_SNDINPUT_VOICEACTIVATED
TeamTalkBase.SetVoiceActivationStopDelay()

Definition at line 5447 of file TeamTalk.cs.

◆ SetVoiceActivationLevel()

bool BearWare.TeamTalkBase.SetVoiceActivationLevel ( int  nLevel)

Set voice activation level.

The current volume level can be queried calling GetSoundInputLevel(). When GetSoundInputLevel() is greater or equal to voice activation level then OnVoiceActivation is triggered.

If BearWare.WebRTCAudioPreprocessor is active with voicedetection enabled then SetVoiceActivationLevel() is not applicable.

Parameters
nLevelMust be between BearWare.SoundLevel.SOUND_VU_MIN and BearWare.SoundLevel.SOUND_VU_MAX
See also
TeamTalkBase.EnableVoiceActivation
TeamTalkBase.GetVoiceActivationLevel

Definition at line 5465 of file TeamTalk.cs.

◆ GetVoiceActivationLevel()

int BearWare.TeamTalkBase.GetVoiceActivationLevel ( )

Get voice activation level.

Returns
Returns A value between BearWare.SoundLevel.SOUND_VU_MIN and BearWare.SoundLevel.SOUND_VU_MAX
See also
TeamTalkBase.EnableVoiceActivation
TeamTalkBase.SetVoiceActivationLevel

Definition at line 5475 of file TeamTalk.cs.

◆ SetVoiceActivationStopDelay()

bool BearWare.TeamTalkBase.SetVoiceActivationStopDelay ( int  nDelayMSec)

Set the delay of when voice activation should be stopped.

When TeamTalkBase.GetSoundInputLevel() becomes higher than the specified voice activation level the client instance will start transmitting until TeamTalkBase.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 TeamTalkBase.SetVoiceActivationStopDelay().

See also
EnableVoiceActivation
SetVoiceActivationLevel

Definition at line 5491 of file TeamTalk.cs.

◆ GetVoiceActivationStopDelay()

int BearWare.TeamTalkBase.GetVoiceActivationStopDelay ( )

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
SetVoiceActivationStopDelay
EnableVoiceActivation
SetVoiceActivationLevel

Definition at line 5505 of file TeamTalk.cs.

◆ StartRecordingMuxedAudioFile() [1/2]

bool BearWare.TeamTalkBase.StartRecordingMuxedAudioFile ( AudioCodec  lpAudioCodec,
string  szAudioFileName,
AudioFileFormat  uAFF 
)

Store all audio conversations with specific BearWare.AudioCodec settings to a single file.

To record conversations from a specific channel to a single file call TeamTalkBase.StartRecordingMuxedAudioFileEx().

TeamTalkBase.StartRecordingMuxedAudioFile() can be used to record conversations "across" channels given that the channels use the same BearWare.AudioCodec properties (i.e. audiocodec member of BearWare.Channel). To receive audio outside the TeamTalk instance's channel use TeamTalkBase.DoSubscribe() and Subscription.SUBSCRIBE_INTERCEPT_VOICE.

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 TeamTalkBase.StartRecordingMuxedAudioFile() will enable the ClientFlag.CLIENT_MUX_AUDIOFILE flag from TeamTalkBase.GetFlags().

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

Only StreamType.STREAMTYPE_VOICE is stored into the audio file, not StreamType.STREAMTYPE_MEDIAFILE_AUDIO.

Use TeamTalkBase.SetUserMediaStorageDir() to store users' audio streams in separate files.

Parameters
lpAudioCodecThe 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. TeamTalkBase.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
SetUserMediaStorageDir()
StopRecordingMuxedAudioFile()

Definition at line 5552 of file TeamTalk.cs.

◆ StartRecordingMuxedAudioFile() [2/2]

bool BearWare.TeamTalkBase.StartRecordingMuxedAudioFile ( int  nChannelID,
string  szAudioFileName,
AudioFileFormat  uAFF 
)

Store audio conversations from a specific channel into a single file.

To record audio outside the TeamTalk instance's current channel use the TeamTalkBase.DoSubscribe() with the Subscription.SUBSCRIBE_INTERCEPT_VOICE on all the user's in the channel.

Unlike TeamTalkBase.StartRecordingMuxedAudioFile() this function does not toggle the flag ClientFlag.CLIENT_MUX_AUDIOFILE.

Use TeamTalkBase.StartRecordingMuxedAudioFile() to record conversations from many different channels with the same BearWare.AudioCodec settings.

Only StreamType.STREAMTYPE_VOICE is stored into the audio file, not StreamType.STREAMTYPE_MEDIAFILE_AUDIO.

See also
StopRecordingMuxedAudioFile()

Definition at line 5581 of file TeamTalk.cs.

◆ StartRecordingMuxedStreams()

bool BearWare.TeamTalkBase.StartRecordingMuxedStreams ( StreamType  uStreamTypes,
AudioCodec  lpAudioCodec,
string  szAudioFileName,
AudioFileFormat  uAFF 
)

Mix multiple BearWare.StreamType into a single audio file.

Both voice, media streams, etc. can be mixed together into a single file using this feature.

Streams that can be mixed into a single file are:

StartRecordingMuxedAudioFile() is mutually exclusive with StartRecordingMuxedStreams().

Use StopRecordingMuxedAudioFile() to stop the recording.

Parameters
uStreamTypesThe BearWare.StreamType to mix together. Streams that can be mixed into a single file are:
lpAudioCodecThe reference codec for the recording. The recording will use the sample rate and number of channels specified by the BearWare.AudioCodec.
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
StartRecordingMuxedAudioFile()
StartRecordingMuxedAudioFileEx()
StopRecordingMuxedAudioFileE()

Definition at line 5623 of file TeamTalk.cs.

◆ StopRecordingMuxedAudioFile() [1/2]

bool BearWare.TeamTalkBase.StopRecordingMuxedAudioFile ( )

Stop an active muxed audio recording.

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

Calling TeamTalkBase.StopRecordingMuxedAudioFile() will clear the ClientFlag.CLIENT_MUX_AUDIOFILE flag from TeamTalkBase.GetFlags().

See also
StartRecordingMuxedAudioFile()

Definition at line 5642 of file TeamTalk.cs.

◆ StopRecordingMuxedAudioFile() [2/2]

bool BearWare.TeamTalkBase.StopRecordingMuxedAudioFile ( int  nChannelID)

Stop recording conversations from a channel to a single file.

Stop a recording initiated by TeamTalkBase.StartRecordingMuxedAudioFileEx().

See also
StopRecordingMuxedAudioFile()

Definition at line 5653 of file TeamTalk.cs.

◆ StartVideoCaptureTransmission()

bool BearWare.TeamTalkBase.StartVideoCaptureTransmission ( VideoCodec  lpVideoCodec)

Start transmitting from video capture device.

The video capture device is initiated by calling TeamTalkBase.InitVideoCaptureDevice(). After joining a channel and calling this function the other users will see the video from the capture device.

Video capture data is transmitted with stream type StreamType.STREAMTYPE_VIDEOCAPTURE and is subscribed/unsubscribed using Subscription.SUBSCRIBE_VIDEOCAPTURE.

To stop transmitting call TeamTalkBase.StopVideoCaptureTransmission()

User rights required:

Parameters
lpVideoCodecThe video codec settings to use for transmission.
See also
TeamTalkBase.StartStreamingMediaFileToChannel()
TeamTalkBase.EnableVoiceTransmission()

Definition at line 5680 of file TeamTalk.cs.

◆ StopVideoCaptureTransmission()

bool BearWare.TeamTalkBase.StopVideoCaptureTransmission ( )

Stop transmitting from video capture device.

See also
TeamTalkBase.StartVideoCaptureTransmission()

Definition at line 5689 of file TeamTalk.cs.