TeamTalk 5 .NET DLL Version 5.12A
Stream Media Files

Get or query the raw RGB32 bitmap data of a user's video frame. More...

Classes

struct  BearWare.AudioFormat
 Struct describing the audio format used by a media file. More...
 
struct  BearWare.MediaFileInfo
 Struct describing the audio and video format used by a media file. More...
 
struct  BearWare.MediaFilePlayback
 Properties for initializing or updating a file for media streaming. More...
 
struct  BearWare.AudioInputProgress
 The progress of the audio currently being processed as audio input. More...
 

Enumerations

enum  BearWare.MediaFileStatus : uint {
  BearWare.MediaFileStatus.MFS_CLOSED = 0 , BearWare.MediaFileStatus.MFS_ERROR = 1 , BearWare.MediaFileStatus.MFS_STARTED = 2 , BearWare.MediaFileStatus.MFS_FINISHED = 3 ,
  BearWare.MediaFileStatus.MFS_ABORTED = 4 , BearWare.MediaFileStatus.MFS_PAUSED = 5 , BearWare.MediaFileStatus.MFS_PLAYING = 6
}
 Status of media file being written to disk. More...
 
enum  BearWare.AudioFileFormat : uint {
  BearWare.AudioFileFormat.AFF_NONE = 0 , BearWare.AudioFileFormat.AFF_CHANNELCODEC_FORMAT = 1 , BearWare.AudioFileFormat.AFF_WAVE_FORMAT = 2 , BearWare.AudioFileFormat.AFF_MP3_16KBIT_FORMAT = 3 ,
  BearWare.AudioFileFormat.AFF_MP3_32KBIT_FORMAT = 4 , BearWare.AudioFileFormat.AFF_MP3_64KBIT_FORMAT = 5 , BearWare.AudioFileFormat.AFF_MP3_128KBIT_FORMAT = 6 , BearWare.AudioFileFormat.AFF_MP3_256KBIT_FORMAT = 7
}
 Media file formats supported for muxed audio recordings. More...
 

Functions

bool BearWare.TeamTalkBase.StartStreamingMediaFileToChannel (string szMediaFilePath, VideoCodec lpVideoCodec)
 Stream media file to channel, e.g. avi-, wav- or MP3-file. More...
 
bool BearWare.TeamTalkBase.StartStreamingMediaFileToChannel (string szMediaFilePath, MediaFilePlayback lpMediaFilePlayback, VideoCodec lpVideoCodec)
 Stream media file to channel, e.g. avi-, wav- or MP3-file. More...
 
bool BearWare.TeamTalkBase.UpdateStreamingMediaFileToChannel (MediaFilePlayback lpMediaFilePlayback, VideoCodec lpVideoCodec)
 Update active media file being streamed to channel. More...
 
bool BearWare.TeamTalkBase.StopStreamingMediaFileToChannel ()
 Stop streaming media file to channel. More...
 
int BearWare.TeamTalkBase.InitLocalPlayback (string szMediaFilePath, MediaFilePlayback lpMediaFilePlayback)
 Play media file using settings from TeamTalkBase instance. More...
 
bool BearWare.TeamTalkBase.UpdateLocalPlayback (int nPlaybackSessionID, MediaFilePlayback lpMediaFilePlayback)
 
bool BearWare.TeamTalkBase.StopLocalPlayback (int nPlaybackSessionID)
 
static bool BearWare.TeamTalkBase.GetMediaFileInfo (string szMediaFilePath, ref MediaFileInfo lpMediaFileInfo)
 Get the properties of a media file. More...
 
VideoFrame BearWare.TeamTalkBase.AcquireUserMediaVideoFrame (int nUserID, out Bitmap bmp)
 Extract a user's media video frame for display. More...
 
bool BearWare.TeamTalkBase.ReleaseUserMediaVideoFrame (VideoFrame lpVideoFrame)
 Delete a user's video frame, acquired through TeamTalkBase.AcquireUserMediaVideoFrame(), so its allocated resources can be released. More...
 

Variables

const uint BearWare.TeamTalkBase.TT_MEDIAPLAYBACK_OFFSET_IGNORE = 0xFFFFFFFF
 

Detailed Description

Get or query the raw RGB32 bitmap data of a user's video frame.

Media files, mp3, avi, wmv, wma, etc. can be streamed to a channel and controlled separately from the voice and video capture input. Streaming a media file requires UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_AUDIO and/or UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_VIDEO.

The media formats supported by the TeamTalk DLL depends on the platform. On Windows the Windows Media Player's API is used to convert media files to TeamTalk's internal formats (i.e. Speex, OPUS and WebM). So whatever Windows Media Player can play should also be possible to stream using TeamTalkBase. On Mac and Linux avconv is used for converting media files which in similar way makes use of what the platform provides.

Use BearWare.TeamTalkBase.GetMediaFileInfo() to see if the media file format is supported and what properties are used for audio and video.

To stream a media file to a channel call BearWare.TeamTalkBase.StartStreamingMediaFileToChannel() and to stop the stream call BearWare.TeamTalkBase.StopStreamingMediaFileToChannel(). The user receiving the media stream can control volume levels by calling BearWare.TeamTalkBase.SetUserVolume() and BearWare.TeamTalkBase.AcquireUserMediaVideoFrame() to obtain video frames.

Subscription of media files is controlled by Subscription.SUBSCRIBE_MEDIAFILE.

Parameters
nUserIDThe user's ID. 0 for local client instance.
lpPictureReference to a bitmap which will receive the video frame. If the lpPicture reference is null or not the proper size a new Bitmap object will be allocated and returned instead. Ensure to ALWAYS call with the same lpPicture reference for each nUserID, otherwise a new Bitmap object will be allocated each time and cause the application to use a significant amount of memory.
See also
PaintVideoFrame

Enumeration Type Documentation

◆ MediaFileStatus

Status of media file being written to disk.

See also
CLIENTEVENT_USER_RECORD_MEDIAFILE
Enumerator
MFS_CLOSED 
MFS_ERROR 

Error while processing media file.

MFS_STARTED 

Started processing media file.

MFS_FINISHED 

Finished processing media file.

MFS_ABORTED 

Aborted processing of media file.

MFS_PAUSED 

Paused processing of media file.

MFS_PLAYING 

Playing media file with updated uElapsedMSec of BearWare.MediaFileInfo.

Definition at line 518 of file TeamTalk.cs.

◆ AudioFileFormat

Media file formats supported for muxed audio recordings.

See also
TeamTalkBase.StartRecordingMuxedAudioFile()
Enumerator
AFF_NONE 

Used to denote nothing selected.

AFF_CHANNELCODEC_FORMAT 

Store audio in the same format as the BearWare.Channel's configured audio codec.

Audio is stored in OGG format. OGG format is supported by https://www.xiph.org/ogg and can be played using VLC media player http://www.videolan.org

Requires TeamTalk version 5.2.0.4730.

See also
TeamTalkBase.SetUserMediaStorageDir()
TeamTalkBase.StartRecordingMuxedAudioFile()
AFF_WAVE_FORMAT 

Store in PCM 16-bit wave format.

AFF_MP3_16KBIT_FORMAT 

Store in MP3-format.

AFF_MP3_32KBIT_FORMAT 
See also
AudioFileFormat.AFF_MP3_16KBIT_FORMAT
AFF_MP3_64KBIT_FORMAT 
See also
AudioFileFormat.AFF_MP3_16KBIT_FORMAT
AFF_MP3_128KBIT_FORMAT 
See also
AudioFileFormat.AFF_MP3_16KBIT_FORMAT
AFF_MP3_256KBIT_FORMAT 
See also
AudioFileFormat.AFF_MP3_16KBIT_FORMAT

Definition at line 539 of file TeamTalk.cs.

Function Documentation

◆ StartStreamingMediaFileToChannel() [1/2]

bool BearWare.TeamTalkBase.StartStreamingMediaFileToChannel ( string  szMediaFilePath,
VideoCodec  lpVideoCodec 
)

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

See also
TeamTalkBase.StartStreamingMediaFileToChannel()

Definition at line 5920 of file TeamTalk.cs.

◆ StartStreamingMediaFileToChannel() [2/2]

bool BearWare.TeamTalkBase.StartStreamingMediaFileToChannel ( string  szMediaFilePath,
MediaFilePlayback  lpMediaFilePlayback,
VideoCodec  lpVideoCodec 
)

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

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

The event ClientEvent.CLIENTEVENT_STREAM_MEDIAFILE is posted when the media file starts streaming. The flags ClientFlag.CLIENT_STREAM_AUDIO and/or ClientFlag.CLIENT_STREAM_VIDEO will be set if the call is successful.

A media file is streamed using StreamType.STREAMTYPE_MEDIAFILE_AUDIO and/or StreamType.STREAMTYPE_MEDIAFILE_VIDEO. To subscribe/unsubscribe a media file being streamed use Subscription.SUBSCRIBE_MEDIAFILE.

Streaming a media file requires UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_VIDEO and/or UserRight.USERRIGHT_TRANSMIT_MEDIAFILE_AUDIO.

Parameters
szMediaFilePathFile path to media file.
lpMediaFilePlaybackPlayback settings to pause, seek and preprocess audio. If AudioPreprocessorType.SPEEXDSP_AUDIOPREPROCESSOR then the echo cancellation part of BearWare.SpeexDSP is unused. Only denoise and AGC settings are applied.
lpVideoCodecIf video file then specify output codec properties here. Specify Codec .NO_CODEC if video should be ignored.
See also
TeamTalkBase.UpdateStreamingMediaFileToChannel()
TeamTalkBase.StopStreamingMediaFileToChannel()
TeamTalkBase.InitLocalPlayback()

Definition at line 5956 of file TeamTalk.cs.

◆ UpdateStreamingMediaFileToChannel()

bool BearWare.TeamTalkBase.UpdateStreamingMediaFileToChannel ( MediaFilePlayback  lpMediaFilePlayback,
VideoCodec  lpVideoCodec 
)

Update active media file being streamed to channel.

While streaming a media file to a channel it's possible to pause, seek and manipulate audio preprocessing by passing new BearWare.MediaFilePlayback properties.

Parameters
lpMediaFilePlaybackPlayback settings to pause, seek and preprocess audio. If AudioPreprocessorType.SPEEXDSP_AUDIOPREPROCESSOR then the echo cancellation part of BearWare.SpeexDSP is unused. Only denoise and AGC settings are applied.
lpVideoCodecIf video file then specify output codec properties here, otherwise NULL.
See also
TeamTalkBase.StartStreamingMediaFileToChannel()
TeamTalkBase.StopStreamingMediaFileToChannel()

Definition at line 5981 of file TeamTalk.cs.

◆ StopStreamingMediaFileToChannel()

bool BearWare.TeamTalkBase.StopStreamingMediaFileToChannel ( )

Stop streaming media file to channel.

This will clear the flags ClientFlag.CLIENT_STREAM_AUDIO and/or ClientFlag.CLIENT_STREAM_VIDEO.

See also
TeamTalkBase.StartStreamingMediaFileToChannel()

Definition at line 5994 of file TeamTalk.cs.

◆ InitLocalPlayback()

int BearWare.TeamTalkBase.InitLocalPlayback ( string  szMediaFilePath,
MediaFilePlayback  lpMediaFilePlayback 
)

Play media file using settings from TeamTalkBase instance.

The sound system properties of the TeamTalkBase instance will be used for playback, i.e. TeamTalkBase.SetSoundOutputMute(), TeamTalkBase.SetSoundOutputVolume() and TeamTalkBase.InitSoundOutputDevice().

Monitor progress of playback by checking for event OnLocalMediaFile.

Parameters
szMediaFilePathPath to media file.
lpMediaFilePlaybackPlayback settings to pause, seek and preprocess audio. If AudioPreprocessorType.SPEEXDSP_AUDIOPREPROCESSOR then the echo cancellation part of BearWare.SpeexDSP is unused. Only denoise and AGC settings are applied.
Returns
A Session ID for identifing the media playback session. If Session ID is <= 0 indicates an error.
A session ID identifier referred to as nPlaybackSessionID.
See also
TeamTalkBase.UpdateLocalPlayback()
TeamTalkBase.StopLocalPlayback()
TeamTalkBase.StartStreamingMediaFileToChannel()

Definition at line 6023 of file TeamTalk.cs.

◆ UpdateLocalPlayback()

bool BearWare.TeamTalkBase.UpdateLocalPlayback ( int  nPlaybackSessionID,
MediaFilePlayback  lpMediaFilePlayback 
)

Update media file currently being played by TeamTalk instance.

Parameters
nPlaybackSessionIDSession ID created by TeamTalkBase.InitLocalPlayback().
lpMediaFilePlaybackBearWare.AudioPreprocessorType of BearWare.AudioPreprocessor cannot be changed. It must be the same as used in TeamTalkBase.InitLocalPlayback().
See also
TeamTalkBase.InitLocalPlayback()
TeamTalkBase.StopLocalPlayback()
TeamTalkBase.UpdateStreamingMediaFileToChannel()

Definition at line 6039 of file TeamTalk.cs.

◆ StopLocalPlayback()

bool BearWare.TeamTalkBase.StopLocalPlayback ( int  nPlaybackSessionID)

Stop media file currently being played by TeamTalk instance.

Parameters
nPlaybackSessionIDSession ID created by TeamTalkBase.InitLocalPlayback().
See also
TeamTalkBase.InitLocalPlayback()
TeamTalkBase.UpdateLocalPlayback()
TeamTalkBase.StopStreamingMediaFileToChannel()

Definition at line 6053 of file TeamTalk.cs.

◆ GetMediaFileInfo()

static bool BearWare.TeamTalkBase.GetMediaFileInfo ( string  szMediaFilePath,
ref MediaFileInfo  lpMediaFileInfo 
)
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.

See also
TeamTalkBase.StartStreamingMediaFileToChannel()

Definition at line 6065 of file TeamTalk.cs.

◆ AcquireUserMediaVideoFrame()

VideoFrame BearWare.TeamTalkBase.AcquireUserMediaVideoFrame ( int  nUserID,
out Bitmap  bmp 
)

Extract a user's media video frame for display.

The BearWare.VideoFrame extracted from the client instance will contain a pointer to the image's frame buffer, so a RGB32 bitmap can be displayed in a window control.

To release the acquired BearWare.VideoFrame call TeamTalkBase.ReleaseUserMediaVideoFrame().

A media video frame comes from a user's StreamType.STREAMTYPE_MEDIAFILE_VIDEO.

Parameters
nUserIDThe user's ID. 0 for local user.
bmpA bitmap created from the BearWare.VideoFrame's data.
Returns
Returns video frame which will contain the image data. Note that it's the frameBuffer member of BearWare.VideoFrame which will contain the image data allocated internally by TeamTalkBase. Returns NULL if no video frame could be acquired.
See also
TeamTalkBase.ReleaseUserMediaVideoFrame()

Definition at line 6090 of file TeamTalk.cs.

◆ ReleaseUserMediaVideoFrame()

bool BearWare.TeamTalkBase.ReleaseUserMediaVideoFrame ( VideoFrame  lpVideoFrame)

Delete a user's video frame, acquired through TeamTalkBase.AcquireUserMediaVideoFrame(), so its allocated resources can be released.

Parameters
lpVideoFramePointer to BearWare.VideoFrame which should be deallocated.
Returns
Returns TRUE if a video frame was successfully deallocated.
See also
AcquireUserMediaVideoFrame()

Definition at line 6112 of file TeamTalk.cs.

Variable Documentation

◆ TT_MEDIAPLAYBACK_OFFSET_IGNORE

const uint BearWare.TeamTalkBase.TT_MEDIAPLAYBACK_OFFSET_IGNORE = 0xFFFFFFFF
static

Specify this value as uOffsetMSec in BearWare.MediaFilePlayback when calling BearWare.TeamTalkBase.InitLocalPlayback() and TeamTalkBase.UpdateLocalPlayback() to ignore rewind or forward.

Definition at line 4290 of file TeamTalk.cs.