TeamTalk 5 .NET DLL: Audio and Video Transmission

TeamTalk 5 .NET DLL Version 5.18A

Loading...
Searching...
No Matches
Enumerations | Functions
Audio and Video Transmission

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

## Enumerations

enum

BearWare.StreamType : uint {
BearWare.StreamType.STREAMTYPE_NONE = 0x00000000 , BearWare.StreamType.STREAMTYPE_VOICE = 0x00000001 , BearWare.StreamType.STREAMTYPE_VIDEOCAPTURE = 0x00000002 , BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO = 0x00000004 ,
BearWare.StreamType.STREAMTYPE_MEDIAFILE_VIDEO = 0x00000008 , BearWare.StreamType.STREAMTYPE_DESKTOP = 0x00000010 , BearWare.StreamType.STREAMTYPE_DESKTOPINPUT = 0x00000020 , BearWare.StreamType.STREAMTYPE_MEDIAFILE ,
BearWare.StreamType.STREAMTYPE_CHANNELMSG = 0x00000040 , BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO = 0x00000080 , BearWare.StreamType.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 BearWare.StreamType.STREAMTYPE_VOICE, i.e. microphone input.
bool | BearWare.TeamTalkBase.EnableVoiceTransmission (bool bEnable)
| Start/stop transmitting of voice data from sound input.
bool | BearWare.TeamTalkBase.EnableVoiceActivation (bool bEnable)
| Enable voice activation.
bool | BearWare.TeamTalkBase.SetVoiceActivationLevel (int nLevel)
| Set voice activation level.
int | BearWare.TeamTalkBase.GetVoiceActivationLevel ()
| Get voice activation level.
bool | BearWare.TeamTalkBase.SetVoiceActivationStopDelay (int nDelayMSec)
| Set the delay of when voice activation should be stopped.
int | BearWare.TeamTalkBase.GetVoiceActivationStopDelay ()
| Get the delay of when voice active state should be disabled.
bool | BearWare.TeamTalkBase.StartRecordingMuxedAudioFile (AudioCodec lpAudioCodec, string szAudioFileName, AudioFileFormat uAFF)
| Store all audio conversations with specific BearWare.AudioCodec settings to a single file.
bool | BearWare.TeamTalkBase.StartRecordingMuxedAudioFile (int nChannelID, string szAudioFileName, AudioFileFormat uAFF)
| Store audio conversations from a specific channel into a single file.
bool | BearWare.TeamTalkBase.StartRecordingMuxedStreams (StreamType uStreamTypes, AudioCodec lpAudioCodec, string szAudioFileName, AudioFileFormat uAFF)
| Mix multiple BearWare.StreamType into a single audio file.
bool | BearWare.TeamTalkBase.StopRecordingMuxedAudioFile ()
| Stop an active muxed audio recording.
bool | BearWare.TeamTalkBase.StopRecordingMuxedAudioFile (int nChannelID)
| Stop recording conversations from a channel to a single file.
bool | BearWare.TeamTalkBase.StartVideoCaptureTransmission (VideoCodec lpVideoCodec)
| Start transmitting from video capture device.
bool | BearWare.TeamTalkBase.StopVideoCaptureTransmission ()
| Stop transmitting from video capture device.

## 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

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 BearWare.StreamType.STREAMTYPE_VOICE, i.e. microphone input.

Since BearWare.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 BearWare.ClientFlag.CLIENT_TX_VOICE or BearWare.ClientFlag.CLIENT_SNDINPUT_VOICEACTIVATED are active then calling TeamTalkBase.InputAudioBlock() will fail because BearWare.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 BearWare.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

  lpAudioBlock | The 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 BearWare.ClientEvent.CLIENTEVENT_AUDIOINPUT. The member `uSampleIndex` of BearWare.AudioBlock is ignored.

Definition at line 5388 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 BearWare.StreamType.STREAMTYPE_VOICE.

User rights required:

- BearWare.UserRight.USERRIGHT_TRANSMIT_VOICE

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

Parameters

  bEnable | Enable/disable transmission.

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

Definition at line 5410 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 BearWare.StreamType.STREAMTYPE_VOICE.

User rights required:

- BearWare.UserRight.USERRIGHT_TRANSMIT_VOICE

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

Parameters

  bEnable | TRUE to enable, otherwise FALSE.

Returns
  TRUE on success. FALSE if voice activation cannot be enabled on the client instance.

See also
  BearWare.ClientFlag.CLIENT_SNDINPUT_VOICEACTIVATED
  TeamTalkBase.SetVoiceActivationStopDelay()

Definition at line 5440 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.

Parameters

  nLevel | Must be between BearWare.SoundLevel.SOUND_VU_MIN and BearWare.SoundLevel.SOUND_VU_MAX

See also
  TeamTalkBase.EnableVoiceActivation
  TeamTalkBase.GetVoiceActivationLevel

Definition at line 5455 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 5465 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 5481 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 5495 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 BearWare.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 BearWare.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 BearWare.StreamType.STREAMTYPE_VOICE is stored into the audio file, not BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.

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

Parameters

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

See also
  SetUserMediaStorageDir()
  StopRecordingMuxedAudioFile()

Definition at line 5542 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 BearWare.Subscription.SUBSCRIBE_INTERCEPT_VOICE on all the user's in the channel.

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

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

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

See also
  StopRecordingMuxedAudioFile()

Definition at line 5571 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:

- BearWare.StreamType.STREAMTYPE_VOICE
- BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO
- BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO

StartRecordingMuxedAudioFile() is mutually exclusive with StartRecordingMuxedStreams().

Use StopRecordingMuxedAudioFile() to stop the recording.

Parameters

  uStreamTypes

  The BearWare.StreamType to mix together. Streams that can be mixed into a single file are:
  - BearWare.StreamType.STREAMTYPE_VOICE
  - BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO
  - BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO

  lpAudioCodec | The reference codec for the recording. The recording will use the sample rate and number of channels specified by the BearWare.AudioCodec.
  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.

See also
  StartRecordingMuxedAudioFile()
  StartRecordingMuxedAudioFileEx()
  StopRecordingMuxedAudioFileE()

Definition at line 5613 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 BearWare.ClientFlag.CLIENT_MUX_AUDIOFILE flag from TeamTalkBase.GetFlags().

See also
  StartRecordingMuxedAudioFile()

Definition at line 5632 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 5643 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 BearWare.StreamType.STREAMTYPE_VIDEOCAPTURE and is subscribed/unsubscribed using BearWare.Subscription.SUBSCRIBE_VIDEOCAPTURE.

To stop transmitting call TeamTalkBase.StopVideoCaptureTransmission()

User rights required:

- BearWare.UserRight.USERRIGHT_TRANSMIT_VIDEOCAPTURE.

Parameters

  lpVideoCodec | The video codec settings to use for transmission.

See also
  TeamTalkBase.StartStreamingMediaFileToChannel()
  TeamTalkBase.EnableVoiceTransmission()

Definition at line 5670 of file TeamTalk.cs.

## ◆ StopVideoCaptureTransmission()

bool BearWare.TeamTalkBase.StopVideoCaptureTransmission | ( |  | ) |

Stop transmitting from video capture device.

See also
  TeamTalkBase.StartVideoCaptureTransmission()

Definition at line 5679 of file TeamTalk.cs.