TeamTalk 5 C-API DLL Version 5.15A
Loading...
Searching...
No Matches
Audio and Video Codecs

This section explains how to configure audio and video codecs. More...

Classes

struct  SpeexCodec
 Speex audio codec settings for Constant Bitrate mode (CBR). More...
 
struct  SpeexVBRCodec
 Speex audio codec settings for Variable Bitrate mode (VBR). More...
 
struct  OpusCodec
 OPUS audio codec settings. For detailed information about the OPUS codec check out http://www.opus-codec.org. More...
 
struct  SpeexDSP
 Speex DSP is used for specifying how recorded audio from a sound input device should be preprocessed before transmission. More...
 
struct  TTAudioPreprocessor
 Use TeamTalk's internal audio preprocessor for gain audio. Same as used for TT_SetSoundInputGainLevel(). More...
 
struct  WebRTCAudioPreprocessor
 WebRTC's audio preprocessor. More...
 
struct  AudioPreprocessor
 Configure the audio preprocessor specified by nPreprocessor. More...
 
struct  WebMVP8Codec
 WebM video codec settings. More...
 
struct  AudioCodec
 Struct used for specifying which audio codec a channel uses. More...
 
struct  AudioConfig
 Audio configuration for clients in a channel. More...
 
struct  VideoCodec
 Struct used for specifying the video codec to use. More...
 

Macros

#define SPEEX_NB_MIN_BITRATE   2150
 The minimum bitrate for Speex codec in 8 KHz mode. Bandmode = 0.
 
#define SPEEX_NB_MAX_BITRATE   24600
 The maximum bitrate for Speex codec in 8 KHz mode. Bandmode = 0.
 
#define SPEEX_WB_MIN_BITRATE   3950
 The minimum bitrate for Speex codec in 16 KHz mode. Bandmode = 1.
 
#define SPEEX_WB_MAX_BITRATE   42200
 The maximum bitrate for Speex codec in 16 KHz mode. Bandmode = 1.
 
#define SPEEX_UWB_MIN_BITRATE   4150
 The minimum bitrate for Speex codec in 32 KHz mode. Bandmode = 2.
 
#define SPEEX_UWB_MAX_BITRATE   44000
 The maximum bitrate for Speex codec in 32 KHz mode. Bandmode = 2.
 
#define OPUS_APPLICATION_VOIP   2048
 Audio encoding is for VoIP. This value should be set as nApplicaton in OpusCodec.
 
#define OPUS_APPLICATION_AUDIO   2049
 Audio encoding is for music. This value should be set as nApplicaton in OpusCodec.
 
#define OPUS_MIN_BITRATE   6000
 The minimum bitrate for OPUS codec. Checkout nBitRate of OpusCodec.
 
#define OPUS_MAX_BITRATE   510000
 The maximum bitrate for OPUS codec. Checkout nBitRate of OpusCodec.
 
#define OPUS_MIN_FRAMESIZE   2 /* Actually it's 2.5 */
 The minimum frame size for OPUS codec. Checkout nFrameSizeMSec of OpusCodec.
 
#define OPUS_MAX_FRAMESIZE   60
 The maximum frame size for OPUS codec. Checkout nFrameSizeMSec of OpusCodec.
 
#define OPUS_REALMAX_FRAMESIZE   120
 The real maximum frame size for OPUS codec. Checkout nFrameSizeMSec of OpusCodec. Although OPUS states it only supports 2.5 - 60 msec, it actually support up to 120 msec.
 
#define WEBRTC_GAINCONTROLLER2_FIXEDGAIN_MAX   49.9f
 Max value for fGainDB in WebRTCAudioPreprocessor's gaincontroller2.
 
#define WEBM_VPX_DL_REALTIME   1
 nEncodeDeadline value for fastest encoding.
 
#define WEBM_VPX_DL_GOOD_QUALITY   1000000
 nEncodeDeadline value for good encoding.
 
#define WEBM_VPX_DL_BEST_QUALITY   0
 nEncodeDeadline value for best encoding.
 

Typedefs

typedef struct SpeexCodec SpeexCodec
 Speex audio codec settings for Constant Bitrate mode (CBR).
 
typedef struct SpeexVBRCodec SpeexVBRCodec
 Speex audio codec settings for Variable Bitrate mode (VBR).
 
typedef struct OpusCodec OpusCodec
 OPUS audio codec settings. For detailed information about the OPUS codec check out http://www.opus-codec.org.
 
typedef struct SpeexDSP SpeexDSP
 Speex DSP is used for specifying how recorded audio from a sound input device should be preprocessed before transmission.
 
typedef struct TTAudioPreprocessor TTAudioPreprocessor
 Use TeamTalk's internal audio preprocessor for gain audio. Same as used for TT_SetSoundInputGainLevel().
 
typedef struct WebRTCAudioPreprocessor WebRTCAudioPreprocessor
 WebRTC's audio preprocessor.
 
typedef enum AudioPreprocessorType AudioPreprocessorType
 The types of supported audio preprocessors.
 
typedef struct AudioPreprocessor AudioPreprocessor
 Configure the audio preprocessor specified by nPreprocessor.
 
typedef struct WebMVP8Codec WebMVP8Codec
 WebM video codec settings.
 
typedef enum Codec Codec
 The codecs supported.
 
typedef struct AudioCodec AudioCodec
 Struct used for specifying which audio codec a channel uses.
 
typedef struct AudioConfig AudioConfig
 Audio configuration for clients in a channel.
 
typedef struct VideoCodec VideoCodec
 Struct used for specifying the video codec to use.
 

Enumerations

enum  AudioPreprocessorType { NO_AUDIOPREPROCESSOR = 0 , SPEEXDSP_AUDIOPREPROCESSOR = 1 , TEAMTALK_AUDIOPREPROCESSOR = 2 , WEBRTC_AUDIOPREPROCESSOR = 3 }
 The types of supported audio preprocessors. More...
 
enum  Codec {
  NO_CODEC = 0 , SPEEX_CODEC = 1 , SPEEX_VBR_CODEC = 2 , OPUS_CODEC = 3 ,
  WEBM_VP8_CODEC = 128
}
 The codecs supported. More...
 

Detailed Description

This section explains how to configure audio and video codecs.

The client is able to encode audio in Speex and OPUS format whereas video can be encoded in WebM format. OPUS is recommended for audio encoding, both for voice and music.

Choosing the right codec settings in an end-user application is very important and proper settings depend entirely on the user scenario. Always ensure that the codec settings do not require too much bandwidth and thereby resulting in packetloss causing inaudible conversations and poor video quality. Detecting packetloss can be done using UserStatistics and ClientStatistics.

Every channel must configure which audio codec to use in order for users to be able to talk to each other. The audiocodec member of Channel specifies which audio codec (AudioCodec) should be used. A channel does not restrict the video codec (VideoCodec) users are using.

Macro Definition Documentation

◆ SPEEX_NB_MIN_BITRATE

#define SPEEX_NB_MIN_BITRATE   2150

The minimum bitrate for Speex codec in 8 KHz mode. Bandmode = 0.

Definition at line 1130 of file TeamTalk.h.

◆ SPEEX_NB_MAX_BITRATE

#define SPEEX_NB_MAX_BITRATE   24600

The maximum bitrate for Speex codec in 8 KHz mode. Bandmode = 0.

Definition at line 1133 of file TeamTalk.h.

◆ SPEEX_WB_MIN_BITRATE

#define SPEEX_WB_MIN_BITRATE   3950

The minimum bitrate for Speex codec in 16 KHz mode. Bandmode = 1.

Definition at line 1136 of file TeamTalk.h.

◆ SPEEX_WB_MAX_BITRATE

#define SPEEX_WB_MAX_BITRATE   42200

The maximum bitrate for Speex codec in 16 KHz mode. Bandmode = 1.

Definition at line 1139 of file TeamTalk.h.

◆ SPEEX_UWB_MIN_BITRATE

#define SPEEX_UWB_MIN_BITRATE   4150

The minimum bitrate for Speex codec in 32 KHz mode. Bandmode = 2.

Definition at line 1142 of file TeamTalk.h.

◆ SPEEX_UWB_MAX_BITRATE

#define SPEEX_UWB_MAX_BITRATE   44000

The maximum bitrate for Speex codec in 32 KHz mode. Bandmode = 2.

Definition at line 1145 of file TeamTalk.h.

◆ OPUS_APPLICATION_VOIP

#define OPUS_APPLICATION_VOIP   2048

Audio encoding is for VoIP. This value should be set as nApplicaton in OpusCodec.

Definition at line 1192 of file TeamTalk.h.

◆ OPUS_APPLICATION_AUDIO

#define OPUS_APPLICATION_AUDIO   2049

Audio encoding is for music. This value should be set as nApplicaton in OpusCodec.

Definition at line 1195 of file TeamTalk.h.

◆ OPUS_MIN_BITRATE

#define OPUS_MIN_BITRATE   6000

The minimum bitrate for OPUS codec. Checkout nBitRate of OpusCodec.

Definition at line 1198 of file TeamTalk.h.

◆ OPUS_MAX_BITRATE

#define OPUS_MAX_BITRATE   510000

The maximum bitrate for OPUS codec. Checkout nBitRate of OpusCodec.

Definition at line 1201 of file TeamTalk.h.

◆ OPUS_MIN_FRAMESIZE

#define OPUS_MIN_FRAMESIZE   2 /* Actually it's 2.5 */

The minimum frame size for OPUS codec. Checkout nFrameSizeMSec of OpusCodec.

Definition at line 1204 of file TeamTalk.h.

◆ OPUS_MAX_FRAMESIZE

#define OPUS_MAX_FRAMESIZE   60

The maximum frame size for OPUS codec. Checkout nFrameSizeMSec of OpusCodec.

Definition at line 1207 of file TeamTalk.h.

◆ OPUS_REALMAX_FRAMESIZE

#define OPUS_REALMAX_FRAMESIZE   120

The real maximum frame size for OPUS codec. Checkout nFrameSizeMSec of OpusCodec. Although OPUS states it only supports 2.5 - 60 msec, it actually support up to 120 msec.

Definition at line 1211 of file TeamTalk.h.

◆ WEBRTC_GAINCONTROLLER2_FIXEDGAIN_MAX

#define WEBRTC_GAINCONTROLLER2_FIXEDGAIN_MAX   49.9f

Max value for fGainDB in WebRTCAudioPreprocessor's gaincontroller2.

Definition at line 1406 of file TeamTalk.h.

◆ WEBM_VPX_DL_REALTIME

#define WEBM_VPX_DL_REALTIME   1

nEncodeDeadline value for fastest encoding.

See also
WebMVP8Codec

Definition at line 1470 of file TeamTalk.h.

◆ WEBM_VPX_DL_GOOD_QUALITY

#define WEBM_VPX_DL_GOOD_QUALITY   1000000

nEncodeDeadline value for good encoding.

See also
WebMVP8Codec

Definition at line 1473 of file TeamTalk.h.

◆ WEBM_VPX_DL_BEST_QUALITY

#define WEBM_VPX_DL_BEST_QUALITY   0

nEncodeDeadline value for best encoding.

See also
WebMVP8Codec

Definition at line 1476 of file TeamTalk.h.

Typedef Documentation

◆ SpeexCodec

typedef struct SpeexCodec SpeexCodec

Speex audio codec settings for Constant Bitrate mode (CBR).

Deprecated:
Use OpusCodec.
See also
SpeexVBRCodec

◆ SpeexVBRCodec

typedef struct SpeexVBRCodec SpeexVBRCodec

Speex audio codec settings for Variable Bitrate mode (VBR).

Deprecated:
Use OpusCodec.

◆ OpusCodec

typedef struct OpusCodec OpusCodec

OPUS audio codec settings. For detailed information about the OPUS codec check out http://www.opus-codec.org.

◆ SpeexDSP

typedef struct SpeexDSP SpeexDSP

Speex DSP is used for specifying how recorded audio from a sound input device should be preprocessed before transmission.

Deprecated:
Use WebRTCAudioPreprocessor.

Users' audio levels may be diffent due to how their microphone is configured in their OS. Automatic Gain Control (AGC) can be used to ensure all users in the same channel have the same audio level.

Enable the preprocessing configuration by calling TT_SetSoundInputPreprocess().

When joining a Channel and bEnableGainControl of AudioConfig is enabled in the channel then enable sound input preprocessing by setting bEnableAGC to TRUE and nGainLevel of SpeexDSP to the nGainLevel of AudioConfig.

◆ TTAudioPreprocessor

Use TeamTalk's internal audio preprocessor for gain audio. Same as used for TT_SetSoundInputGainLevel().

◆ WebRTCAudioPreprocessor

WebRTC's audio preprocessor.

Use WebRTC's audio preprocessor, https://webrtc.org

Note that WebRTC's can only operate on 10 msec audio frame, so nTxIntervalMSec in AudioCodec must a multiple of 10.

WebRTCAudioPreprocessor is recommended to TT_SetSoundDeviceEffects() on desktop platforms.

Activate WebRTCAudioPreprocessor by calling TT_SetSoundInputPreprocessEx().

◆ AudioPreprocessorType

The types of supported audio preprocessors.

See also
TT_InitLocalPlayback()

◆ AudioPreprocessor

Configure the audio preprocessor specified by nPreprocessor.

◆ WebMVP8Codec

◆ Codec

typedef enum Codec Codec

The codecs supported.

See also
AudioCodec
VideoCodec

◆ AudioCodec

typedef struct AudioCodec AudioCodec

Struct used for specifying which audio codec a channel uses.

◆ AudioConfig

typedef struct AudioConfig AudioConfig

Audio configuration for clients in a channel.

An audio configuration can be used to set common audio properties for all users in a channel. Checkout audiocfg of Channel.

The audio configuration only supports same audio level for all users by manually converting the values to the selected AudioPreprocessor.

See also
TT_SetSoundInputPreprocessEx()
TT_DoMakeChannel()
TT_DoJoinChannel()

◆ VideoCodec

typedef struct VideoCodec VideoCodec

Struct used for specifying the video codec to use.

Enumeration Type Documentation

◆ AudioPreprocessorType

The types of supported audio preprocessors.

See also
TT_InitLocalPlayback()
Enumerator
NO_AUDIOPREPROCESSOR 

Value for specifying that no audio preprocessing should occur.

SPEEXDSP_AUDIOPREPROCESSOR 

Use the SpeexDSP audio preprocessor.

TEAMTALK_AUDIOPREPROCESSOR 

Use TeamTalk's internal audio preprocessor TTAudioPreprocessor.

WEBRTC_AUDIOPREPROCESSOR 

Use WebRTC's audio preprocessor from WebRTCAudioPreprocessor. https://webrtc.org.

Definition at line 1411 of file TeamTalk.h.

◆ Codec

enum Codec

The codecs supported.

See also
AudioCodec
VideoCodec
Enumerator
NO_CODEC 

No codec specified.

SPEEX_CODEC 

Speex audio codec, http://www.speex.org.

See also
SpeexCodec
SPEEX_VBR_CODEC 

Speex audio codec in VBR mode, http://www.speex.org.

See also
SpeexVBRCodec
OPUS_CODEC 

OPUS audio codec.

See also
OpusCodec
WEBM_VP8_CODEC 

WebM video codec.

See also
WebMVP8Codec

Definition at line 1481 of file TeamTalk.h.