TeamTalk 5 .NET DLL Version 5.15A
Loading...
Searching...
No Matches
Sound Capture and Playback

This section explains how to record and playback audio in the client instance. More...

Classes

struct  BearWare.SoundDevice
 A struct containing the properties of a sound device for either playback or recording. More...
 
struct  BearWare.SoundDeviceEffects
 Set up audio effects supported by the sound device. More...
 
struct  BearWare.SoundDeviceConstants
 IDs for sound devices. More...
 
struct  BearWare.SoundLevel
 An enum encapsulation the minimum, maximum and default sound levels for input and output sound devices. More...
 
struct  BearWare.AudioBlock
 An audio block containing the raw audio from a user who was talking. More...
 

Enumerations

enum  BearWare.SoundSystem : uint {
  BearWare.SoundSystem.SOUNDSYSTEM_NONE = 0 , BearWare.SoundSystem.SOUNDSYSTEM_WINMM = 1 , BearWare.SoundSystem.SOUNDSYSTEM_DSOUND = 2 , BearWare.SoundSystem.SOUNDSYSTEM_ALSA = 3 ,
  BearWare.SoundSystem.SOUNDSYSTEM_COREAUDIO = 4 , BearWare.SoundSystem.SOUNDSYSTEM_WASAPI = 5 , BearWare.SoundSystem.SOUNDSYSTEM_OPENSLES_ANDROID = 7 , BearWare.SoundSystem.SOUNDSYSTEM_AUDIOUNIT = 8 ,
  BearWare.SoundSystem.SOUNDSYSTEM_AUDIOUNIT_IOS = SOUNDSYSTEM_AUDIOUNIT , BearWare.SoundSystem.SOUNDSYSTEM_PULSEAUDIO = 10
}
 The supported sound systems. More...
 
enum  BearWare.SoundDeviceFeature : uint {
  BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_NONE = 0x0000 , BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_AEC = 0x0001 , BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_AGC = 0x0002 , BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_DENOISE = 0x0004 ,
  BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_3DPOSITION = 0x0008 , BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_DUPLEXMODE = 0x0010 , BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_DEFAULTCOMDEVICE = 0x0020
}
 Features available on a sound device. Checkout uSoundDeviceFeatures on BearWare.SoundDevice. More...
 

Functions

static bool BearWare.TeamTalkBase.GetDefaultSoundDevices (ref int lpnInputDeviceID, ref int lpnOutputDeviceID)
 Get the default sound devices.
 
static bool BearWare.TeamTalkBase.GetDefaultSoundDevicesEx (SoundSystem nSndSystem, ref int lpnInputDeviceID, ref int lpnOutputDeviceID)
 Get the default sound devices for the specified sound system.
 
static bool BearWare.TeamTalkBase.GetSoundDevices (out SoundDevice[] lpSoundDevices)
 Retrieve list of sound devices for recording and playback.
 
static bool BearWare.TeamTalkBase.RestartSoundSystem ()
 Reinitialize sound system (in order to detect new/removed devices).
 
static IntPtr BearWare.TeamTalkBase.StartSoundLoopbackTest (int nInputDeviceID, int nOutputDeviceID, int nSampleRate, int nChannels, bool bDuplexMode, SpeexDSP lpSpeexDSP)
 Perform a record and playback test of specified sound devices along with an audio configuration and ability to try echo cancellation.
 
static IntPtr BearWare.TeamTalkBase.StartSoundLoopbackTest (int nInputDeviceID, int nOutputDeviceID, int nSampleRate, int nChannels, bool bDuplexMode, AudioPreprocessor lpAudioPreprocessor, BearWare.SoundDeviceEffects lpSoundDeviceEffects)
 Perform a record and playback test of specified sound devices along with an audio configuration and ability to try echo cancellation.
 
static bool BearWare.TeamTalkBase.CloseSoundLoopbackTest (IntPtr lpTTSoundLoop)
 Stop recorder and playback test.
 
bool BearWare.TeamTalkBase.InitSoundInputDevice (int nInputDeviceID)
 Initialize the sound input device (for recording audio).
 
bool BearWare.TeamTalkBase.InitSoundInputSharedDevice (int nSampleRate, int nChannels, int nFrameSize)
 Setup sample rate, channels and frame size of shared sound input device.
 
bool BearWare.TeamTalkBase.InitSoundOutputDevice (int nOutputDeviceID)
 Initialize the sound output device (for audio playback).
 
bool BearWare.TeamTalkBase.InitSoundOutputSharedDevice (int nSampleRate, int nChannels, int nFrameSize)
 Setup sample rate, channels and frame size of shared sound output device.
 
bool BearWare.TeamTalkBase.InitSoundDuplexDevices (int nInputDeviceID, int nOutputDeviceID)
 Enable duplex mode where multiple audio streams are mixed into a single stream using software.
 
bool BearWare.TeamTalkBase.CloseSoundInputDevice ()
 Shutdown the input sound device.
 
bool BearWare.TeamTalkBase.CloseSoundOutputDevice ()
 Shutdown the output sound device.
 
bool BearWare.TeamTalkBase.CloseSoundDuplexDevices ()
 Shut down sound devices running in duplex mode.
 
bool BearWare.TeamTalkBase.SetSoundDeviceEffects (SoundDeviceEffects lpSoundDeviceEffect)
 Set up audio effects on a sound device.
 
bool BearWare.TeamTalkBase.GetSoundDeviceEffects (ref SoundDeviceEffects lpSoundDeviceEffect)
 Get the audio effects that are currently enabled.
 
int BearWare.TeamTalkBase.GetSoundInputLevel ()
 Get the volume level of the current recorded audio.
 
bool BearWare.TeamTalkBase.SetSoundInputGainLevel (int nLevel)
 Set voice gaining of recorded audio.
 
int BearWare.TeamTalkBase.GetSoundInputGainLevel ()
 Get voice gain level of outgoing audio.
 
bool BearWare.TeamTalkBase.SetSoundInputPreprocess (SpeexDSP lpSpeexDSP)
 Enable sound preprocessor which should be used for processing audio recorded by the sound input device (voice input).
 
bool BearWare.TeamTalkBase.GetSoundInputPreprocess (ref SpeexDSP lpSpeexDSP)
 Get the sound preprocessor settings which are currently in use for recorded sound input device (voice input).
 
bool BearWare.TeamTalkBase.SetSoundInputPreprocess (AudioPreprocessor lpAudioPreprocessor)
 Enable sound preprocessor which should be used for processing audio recorded by the sound input device (voice input).
 
bool BearWare.TeamTalkBase.GetSoundInputPreprocess (ref AudioPreprocessor lpAudioPreprocessor)
 Get the sound preprocessor settings which are currently in use for recorded sound input device (voice input).
 
bool BearWare.TeamTalkBase.SetSoundOutputVolume (int nVolume)
 Set master volume.
 
int BearWare.TeamTalkBase.GetSoundOutputVolume ()
 Get master volume.
 
bool BearWare.TeamTalkBase.SetSoundOutputMute (bool bMuteAll)
 Set all users mute.
 
bool BearWare.TeamTalkBase.Enable3DSoundPositioning (bool bEnable)
 Enable automatically position users using 3D-sound.
 
bool BearWare.TeamTalkBase.AutoPositionUsers ()
 Automatically position users using 3D-sound.
 
bool BearWare.TeamTalkBase.EnableAudioBlockEvent (int nUserID, StreamType uStreamTypes, bool bEnable)
 Enable/disable access to raw audio from individual users, local microphone input or muxed stream of all users.
 
bool BearWare.TeamTalkBase.EnableAudioBlockEvent (int nUserID, StreamType uStreamTypes, AudioFormat lpAudioFormat, bool bEnable)
 Same as TeamTalkBase.EnableAudioBlockEvent() but option to specify audio output format.
 
bool BearWare.TeamTalkBase.SetUserVolume (int nUserID, StreamType nStreamType, int nVolume)
 Set the volume of a user.
 
bool BearWare.TeamTalkBase.SetUserMute (int nUserID, StreamType nStreamType, bool bMute)
 Mute a user.
 
bool BearWare.TeamTalkBase.SetUserStoppedPlaybackDelay (int nUserID, StreamType nStreamType, int nDelayMSec)
 Set the delay of when a user should no longer be considered as playing audio (either voice or audio from media file).
 
bool BearWare.TeamTalkBase.SetUserJitterControl (int nUserID, StreamType nStreamType, JitterConfig lpJitterConfig)
 Set the configuration for de-jitter measures for a user.
 
bool BearWare.TeamTalkBase.GetUserJitterControl (int nUserID, StreamType nStreamType, ref JitterConfig lpJitterConfig)
 Get the de-jitter configuration for a user.
 
bool BearWare.TeamTalkBase.SetUserPosition (int nUserID, StreamType nStreamType, float x, float y, float z)
 Set the position of a user.
 
bool BearWare.TeamTalkBase.SetUserStereo (int nUserID, StreamType nStreamType, bool bLeftSpeaker, bool bRightSpeaker)
 Set whether a user should speak in the left, right or both speakers. This function only works if BearWare.AudioCodec has been set to use stereo.
 
bool BearWare.TeamTalkBase.SetUserMediaStorageDir (int nUserID, string szFolderPath, string szFileNameVars, AudioFileFormat uAFF)
 Store user's audio to disk.
 
bool BearWare.TeamTalkBase.SetUserMediaStorageDir (int nUserID, string szFolderPath, string szFileNameVars, AudioFileFormat uAFF, int nStopRecordingExtraDelayMSec)
 Store user's audio to disk.
 
bool BearWare.TeamTalkBase.SetUserAudioStreamBufferSize (int nUserID, StreamType uStreamType, int nMSec)
 Change the amount of media data which can be buffered in the user's playback queue.
 
AudioBlock BearWare.TeamTalkBase.AcquireUserAudioBlock (StreamType uStreamTypes, int nUserID)
 Extract the raw audio associated with the event TeamTalkBase.OnUserAudioBlock().
 
bool BearWare.TeamTalkBase.ReleaseUserAudioBlock (AudioBlock lpAudioBlock)
 Release the shared memory of an BearWare.AudioBlock.
 

Variables

const int BearWare.TeamTalkBase.TT_SAMPLERATES_MAX = 16
 

Detailed Description

This section explains how to record and playback audio in the client instance.

Before being able to initialize the sound devices to use for recording and playback the computer's available sound devices must first be queried. This is done using the functions TeamTalkBase.GetSoundInputDevices() and TeamTalkBase.GetSoundOutputDevices(). These two functions return arrays of BearWare.SoundDevice-structs which contains a description of the sound device. In the BearWare.SoundDevice-struct there's a member variable called nDeviceID. This ID should be passed to the client instance's two sound initialization functions TeamTalkBase.InitSoundInputDevice() and TeamTalkBase.InitSoundOutputDevice(). Once this has been done the TeamTalkBase.GetFlags() call will return a value containing the mask bits ClientFlag ClientFlag.CLIENT_SNDINPUT_READY and ClientFlag ClientFlag.CLIENT_SNDOUTPUT_READY.

A computer's default sound devices can be queried using TeamTalkBase.GetDefaultSoundDevices(). A loop-back test of the selected sound devices can be performed using TeamTalkBase.StartSoundLoopbackTest().

Be aware that the sound devices might fail if e.g. a USB sound device is unplugged while the client is talking in a channel. In this case ensure the application is processing the errors ClientError.INTERR_SNDINPUT_FAILURE and ClientError.INTERR_SNDOUTPUT_FAILURE in the TeamTalkBase.OnInternalError() event.

Read section Audio and Video Transmission to see how to transmit recorded audio to other users.

Enumeration Type Documentation

◆ SoundSystem

enum BearWare.SoundSystem : uint

The supported sound systems.

See also
SoundDevice
TeamTalkBase.InitSoundInputDevice()
TeamTalkBase.InitSoundOutputDevice()
TeamTalkBase.InitSoundDuplexDevices()
Enumerator
SOUNDSYSTEM_NONE 

Sound system denoting invalid or not found.

SOUNDSYSTEM_WINMM 

Windows legacy audio system. Should be used on Windows Mobile.

SOUNDSYSTEM_DSOUND 

DirectSound audio system. Should be used on Windows.

SOUNDSYSTEM_ALSA 

Advanced Linux Sound Architecture (ALSA). Should be used on Linux.

Often ALSA sound devices only support a limited number of sample rates so TeamTalk internally use software filters to resample the audio to the sample rate used by the selected audio codecs.

SOUNDSYSTEM_COREAUDIO 

Core Audio. Should be used on MacOS.

SOUNDSYSTEM_WASAPI 

Windows Audio Session API (WASAPI). Should be used on Windows Vista/7/8/10.

WASAPI audio devices typically only support a single sample rate so internally TeamTalk uses software filters to resample audio to the sample rate used by the selected audio codecs.

Check supportedSampleRates and nDefaultSampleRate of BearWare.SoundDevice to see which sample rates are supported.

SOUNDSYSTEM_OPENSLES_ANDROID 

Android sound API.

SOUNDSYSTEM_AUDIOUNIT 

iOS sound API.

   The following sound devices will appear when calling
   TeamTalkBase.GetSoundDevices(). Sound device ID 0 will be AudioUnit
   subtype Remote I/O Unit and sound device ID 1 will be
   AudioUnit subtype Voice-Processing I/O Unit.

   Note that iOS only supports one active Voice-Processing I/O
   Unit, i.e. only one #BearWare.TeamTalkBase instance can use the
   Voice-Processing I/O Unit.

   Add libraries @c AVFoundation.framework and
   @c AudioToolbox.framework.

   Duplex mode is not supported by AudioUnit iOS sound API. 
SOUNDSYSTEM_AUDIOUNIT_IOS 

Same as BearWare.SoundSystem.SOUNDSYSTEM_AUDIOUNIT.

SOUNDSYSTEM_PULSEAUDIO 

PulseAudio API. PulseAudio is typically used on Ubuntu 22.

Definition at line 106 of file TeamTalk.cs.

◆ SoundDeviceFeature

Features available on a sound device. Checkout uSoundDeviceFeatures on BearWare.SoundDevice.

Enumerator
SOUNDDEVICEFEATURE_NONE 
SOUNDDEVICEFEATURE_AEC 

The BearWare.SoundDevice can enable Acoustic Echo Canceler (AEC). Enable AEC use property bEnableAEC on BearWare.SoundDeviceEffects.

See also
TeamTalkBase.SetSoundDeviceEffects()
SOUNDDEVICEFEATURE_AGC 

The BearWare.SoundDevice can enable Automatic Gain Control (AGC). Enable AGC use property bEnableAGC on BearWare.SoundDeviceEffects.

See also
TeamTalkBase.SetSoundDeviceEffects()
SOUNDDEVICEFEATURE_DENOISE 

The BearWare.SoundDevice can enable denoising. Enable denoising use property bEnableDenoising on BearWare.SoundDeviceEffects.

See also
TeamTalkBase.SetSoundDeviceEffects()
SOUNDDEVICEFEATURE_3DPOSITION 

The BearWare.SoundDevice can position user in 3D.

See also
TeamTalkBase.SetUserPosition()
SOUNDDEVICEFEATURE_DUPLEXMODE 

The BearWare.SoundDevice can run in duplex mode.

See also
TeamTalkBase.InitSoundDuplexDevices()
SOUNDDEVICEFEATURE_DEFAULTCOMDEVICE 

The BearWare.SoundDevice is the default communication device. This feature is only supported on BearWare.SoundSystem.SOUNDSYSTEM_WASAPI.

Definition at line 165 of file TeamTalk.cs.

Function Documentation

◆ GetDefaultSoundDevices()

static bool BearWare.TeamTalkBase.GetDefaultSoundDevices ( ref int  lpnInputDeviceID,
ref int  lpnOutputDeviceID 
)
static

Get the default sound devices.

Parameters
lpnInputDeviceIDThe ID of the default input device.
lpnOutputDeviceIDThe ID of the default output device.
See also
TeamTalkBase.InitSoundInputDevice
TeamTalkBase.InitSoundOutputDevice

Definition at line 4729 of file TeamTalk.cs.

◆ GetDefaultSoundDevicesEx()

static bool BearWare.TeamTalkBase.GetDefaultSoundDevicesEx ( SoundSystem  nSndSystem,
ref int  lpnInputDeviceID,
ref int  lpnOutputDeviceID 
)
static

Get the default sound devices for the specified sound system.

See also
TeamTalkBase.GetDefaultSoundDevices()

Definition at line 4738 of file TeamTalk.cs.

◆ GetSoundDevices()

static bool BearWare.TeamTalkBase.GetSoundDevices ( out SoundDevice[]  lpSoundDevices)
static

Retrieve list of sound devices for recording and playback.

Parameters
lpSoundDevicesAn output array of BearWare.SoundDevice-structs which will receive the available sound devices.
See also
TeamTalkBase.GetDefaultSoundDevices
TeamTalkBase.InitSoundInputDevice
TeamTalkBase.InitSoundOutputDevice

Definition at line 4752 of file TeamTalk.cs.

◆ RestartSoundSystem()

static bool BearWare.TeamTalkBase.RestartSoundSystem ( )
static

Reinitialize sound system (in order to detect new/removed devices).

When the TeamTalk client is first initialized all the sound devices are detected and stored in a list inside the client instance. If a user adds or removes e.g. a USB sound device then it's not picked up automatically by the client instance. TeamTalkBase.RestartSoundSystem() can be used to reinitialize the sound system and thereby detect if sound devices have been removed or added.

In order to restart the sound system all sound devices in all client instances must be closed using TeamTalkBase.CloseSoundInputDevice(), TeamTalkBase.CloseSoundoutputDevice() and TeamTalkBase.CloseSoundDuplexDevices().

Definition at line 4776 of file TeamTalk.cs.

◆ StartSoundLoopbackTest() [1/2]

static IntPtr BearWare.TeamTalkBase.StartSoundLoopbackTest ( int  nInputDeviceID,
int  nOutputDeviceID,
int  nSampleRate,
int  nChannels,
bool  bDuplexMode,
SpeexDSP  lpSpeexDSP 
)
static

Perform a record and playback test of specified sound devices along with an audio configuration and ability to try echo cancellation.

Definition at line 4784 of file TeamTalk.cs.

◆ StartSoundLoopbackTest() [2/2]

static IntPtr BearWare.TeamTalkBase.StartSoundLoopbackTest ( int  nInputDeviceID,
int  nOutputDeviceID,
int  nSampleRate,
int  nChannels,
bool  bDuplexMode,
AudioPreprocessor  lpAudioPreprocessor,
BearWare::SoundDeviceEffects  lpSoundDeviceEffects 
)
static

Perform a record and playback test of specified sound devices along with an audio configuration and ability to try echo cancellation.

This function allows the use of BearWare.SpeexDSP to enable AGC and echo cancellation.

Parameters
nInputDeviceIDShould be the nDeviceID extracted through TeamTalkBase.GetSoundDevices().
nOutputDeviceIDShould be the nDeviceID extracted through TeamTalkBase.GetSoundDevices().
nSampleRateThe sample rate the client's recorder should use.
nChannelsNumber of channels to use, i.e. 1 = mono, 2 = stereo.
bDuplexModeBoth input and output devices MUST support the specified sample rate since this loop back test uses duplex mode (
See also
TeamTalkBase.InitSoundDuplexDevices() ). Check out supportedSampleRates of BearWare.SoundDevice to see which sample rates are supported. The BearWare.SoundDevice must have the feature BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_DUPLEXMODE.
Parameters
lpAudioPreprocessorThe preprocessing settings to use, i.e. AGC and denoising properties. Pass NULL to ignore AGC, denoise and AEC.
lpSoundDeviceEffectsThe sound device effects which should be applied before the loopback test is started.
Returns
Returns IntPtr.Zero in case of error, otherwise sound loop instance which can be closed by TeamTalkBase.CloseSoundLoopbackTest();
See also
TeamTalkBase.InitSoundInputDevice()
TeamTalkBase.InitSoundOutputDevice()
TeamTalkBase.InitSoundDuplexDevices()
TeamTalkBase.StopSoundLoopbackTest()

Definition at line 4823 of file TeamTalk.cs.

◆ CloseSoundLoopbackTest()

static bool BearWare.TeamTalkBase.CloseSoundLoopbackTest ( IntPtr  lpTTSoundLoop)
static

Stop recorder and playback test.

See also
TeamTalkBase.InitSoundInputDevice
TeamTalkBase.InitSoundOutputDevice
TeamTalkBase.StartSoundLoopbackTest

Definition at line 4838 of file TeamTalk.cs.

◆ InitSoundInputDevice()

bool BearWare.TeamTalkBase.InitSoundInputDevice ( int  nInputDeviceID)

Initialize the sound input device (for recording audio).

The nDeviceID of the BearWare.SoundDevice should be used as nInputDeviceID.

The nInputDeviceID can be or'ed with BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_SHARED_FLAG if the TeamTalk instance should share recording device with other instances.

Notice fixed sound device ID for some platforms:

Calling this function will set the flag BearWare.ClientFlag.CLIENT_SNDINPUT_READY.

Parameters
nInputDeviceIDThe nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().
See also
BearWare.SoundDevice
GetDefaultSoundDevices
GetSoundDevices
CloseSoundInputDevice
GetSoundInputLevel

Definition at line 4870 of file TeamTalk.cs.

◆ InitSoundInputSharedDevice()

bool BearWare.TeamTalkBase.InitSoundInputSharedDevice ( int  nSampleRate,
int  nChannels,
int  nFrameSize 
)

Setup sample rate, channels and frame size of shared sound input device.

By default a shared sound device (checkout BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_SHARED_FLAG) initialized by TeamTalkBase.InitSoundInputDevice will use the sound device's nDefaultSampleRate, nMaxInputChannels of BearWare.SoundDevice and a frame size (callback buffer) of nDefaultSampleRate * 0.04.

TeamTalkBase.InitSoundInputSharedDevice() can be used to override these default settings.

Note that TeamTalkBase.InitSoundInputSharedDevice() must be called prior to TeamTalkBase.InitSoundInputDevice(). Also ensure no shared sound input device is currently active.

Parameters
nSampleRateThe sample rate to use on the shared device. Must exist in BearWare.SoundDevice's inputSampleRates. Pass zero to reset to default behaviour.
nChannelsThe number of channels to use (mono, stereo). Must be less or equals to BearWare.SoundDevice's nMaxInputChannels. Pass zero to reset to default behaviour.
nFrameSizeThe number of samples in each callback from the shared sound device. A 40 msec callback on a 48 KHz input is calculated like this: nFrameSize = 48000 * 0.04. Pass zero to reset to default behaviour.
See also
InitSoundInputDevice()
InitSoundOutputSharedDevice()

Definition at line 4905 of file TeamTalk.cs.

◆ InitSoundOutputDevice()

bool BearWare.TeamTalkBase.InitSoundOutputDevice ( int  nOutputDeviceID)

Initialize the sound output device (for audio playback).

The nDeviceID of the BearWare.SoundDevice should be used as nOutputDeviceID.

The nOutputDeviceID can be or'ed with BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_SHARED_FLAG if the TeamTalk instance should share output device with other instances.

Notice fixed sound device ID for some platforms:

Calling this function will set the flag BearWare.ClientFlag.CLIENT_SNDOUTPUT_READY.

Parameters
nOutputDeviceIDShould be the nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().
See also
BearWare.SoundDevice
TeamTalkBase.GetDefaultSoundDevices
TeamTalkBase.GetSoundOutputDevices
TeamTalkBase.CloseSoundOutputDevice

Definition at line 4938 of file TeamTalk.cs.

◆ InitSoundOutputSharedDevice()

bool BearWare.TeamTalkBase.InitSoundOutputSharedDevice ( int  nSampleRate,
int  nChannels,
int  nFrameSize 
)

Setup sample rate, channels and frame size of shared sound output device.

By default a shared sound device (checkout BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_SHARED_FLAG) initialized by TeamTalkBase.InitSoundOutputDevice will use the sound device's nDefaultSampleRate, nMaxOutputChannels of BearWare.SoundDevice and a frame size (callback buffer) of nDefaultSampleRate * 0.04.

TeamTalkBase.InitSoundOutputSharedDevice() can be used to override these default settings.

Note that TeamTalkBase.InitSoundOutputSharedDevice() must be called prior to TeamTalkBase.InitSoundOutputDevice(). Also ensure no shared sound output device is currently active.

Parameters
nSampleRateThe sample rate to use on the shared device. Must exist in BearWare.SoundDevice's outputSampleRates. Pass zero to reset to default behaviour.
nChannelsThe number of channels to use (mono, stereo). Must be less or equals to BearWare.SoundDevice's nMaxOutputChannels. Pass zero to reset to default behaviour.
nFrameSizeThe number of samples in each callback from the shared sound device. A 40 msec callback on a 48KHz output is calculated like this: nFrameSize = 48000 * 0.04. Pass zero to reset to default behaviour.
See also
InitSoundInputDevice()
InitSoundOutputSharedDevice()

Definition at line 4972 of file TeamTalk.cs.

◆ InitSoundDuplexDevices()

bool BearWare.TeamTalkBase.InitSoundDuplexDevices ( int  nInputDeviceID,
int  nOutputDeviceID 
)

Enable duplex mode where multiple audio streams are mixed into a single stream using software.

To use duplex mode the feature BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_DUPLEXMODE must be available on the BearWare.SoundDevice.

If TeamTalkBase.InitSoundDuplexDevices() is successful the following flags will be set:

Call TeamTalkBase.CloseSoundDuplexDevices() to shut down duplex mode.

Note that it is only the audio streams from users in the local client instance's current channel which will be mixed. If the local client instance calls TeamTalkBase.DoSubscribe() with BearWare.Subscription BearWare.Subscription.SUBSCRIBE_INTERCEPT_VOICE on a user in another channel then the audio from this user will be started in a separate stream. The reason for this is that the other user may use an audio codec with a different sample rate or number of audio channels.

Parameters
nInputDeviceIDThe nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().
nOutputDeviceIDThe nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().
See also
TeamTalkBase.InitSoundInputDevice()
TeamTalkBase.InitSoundOutputDevice()
TeamTalkBase.EnableEchoCancellation()
TeamTalkBase.CloseSoundDuplexDevices()

Definition at line 5009 of file TeamTalk.cs.

◆ CloseSoundInputDevice()

bool BearWare.TeamTalkBase.CloseSoundInputDevice ( )

Shutdown the input sound device.

Callling this function will clear the flag BearWare.ClientFlag.CLIENT_SNDINPUT_READY.

If the local client instance is running in duplex mode (flag BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX is set) then trying to close the sound device will fail since duplex mode require that both input and output sound devices are active at the same time. Therefore in order to close sound devices running in duplex mode call TeamTalkBase.CloseSoundDuplexDevices().

Returns
If running in sound duplex mode (BearWare.ClientFlag BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX) then ensure to disable duplex mode prior to closing the sound device.
See also
TeamTalkBase.InitSoundInputDevice

Definition at line 5032 of file TeamTalk.cs.

◆ CloseSoundOutputDevice()

bool BearWare.TeamTalkBase.CloseSoundOutputDevice ( )

Shutdown the output sound device.

Callling this function will clear set the flag BearWare.ClientFlag.CLIENT_SNDOUTPUT_READY.

If the local client instance is running in duplex mode (flag BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX is set) then trying to close the sound device will fail since duplex mode require that both input and output sound devices are active at the same time. Therefore in order to close sound devices running in duplex mode call TeamTalkBase.CloseSoundDuplexDevices().

Returns
If running in sound duplex mode (BearWare.ClientFlag BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX) then ensure to disable duplex mode prior to closing the sound device.
See also
TeamTalkBase.InitSoundOutputDevice

Definition at line 5054 of file TeamTalk.cs.

◆ CloseSoundDuplexDevices()

bool BearWare.TeamTalkBase.CloseSoundDuplexDevices ( )

Shut down sound devices running in duplex mode.

Calling this function only applies if sound devices has been initialized with TeamTalkBase.InitSoundDuplexDevices().

Definition at line 5064 of file TeamTalk.cs.

◆ SetSoundDeviceEffects()

bool BearWare.TeamTalkBase.SetSoundDeviceEffects ( SoundDeviceEffects  lpSoundDeviceEffect)

Set up audio effects on a sound device.

Some devices, like Android, enable the user to toggle certain audio effects on their device to improve audio quality. The BearWare.SoundDeviceEffects-struct can be used to toggle these audio effects on the device.

The following sound systems support TeamTalkBase.SetSoundDeviceEffects():

This setting should not be confused with TeamTalkBase.SetSoundInputPreprocessEx() which runs entirely in software and is specific to the BearWare.TeamTalkBase instance.

Investigate BearWare.SoundDeviceFeature to see what audio effects are supported by the available BearWare.SoundDevice.

Note that the sound effects may not be immediately applied since an sound device is not active until the BearWare.TeamTalkBase instance joins a channel where the sound device knowns the sample rate and number of channels (mono/stereo). BearWare.ClientError.INTERR_SNDEFFECT_FAILURE will be posted if the BearWare.SoundDeviceEffects was unable to initialize.

See also
TeamTalkBase.GetSoundDeviceEffects()

Definition at line 5103 of file TeamTalk.cs.

◆ GetSoundDeviceEffects()

bool BearWare.TeamTalkBase.GetSoundDeviceEffects ( ref SoundDeviceEffects  lpSoundDeviceEffect)

Get the audio effects that are currently enabled.

See also
TeamTalkBase.SoundDeviceEffects()

Definition at line 5111 of file TeamTalk.cs.

◆ GetSoundInputLevel()

int BearWare.TeamTalkBase.GetSoundInputLevel ( )

Get the volume level of the current recorded audio.

The current level is updated at an interval specified in a channel's BearWare.AudioCodec.

Note that the volume level will not be available until the client instance joins a channel, i.e. it knows what sample rate to use.

If BearWare.WebRTCAudioPreprocessor is active with levelestimation enabled then the current input level is based on WebRTC's level estimater.

Returns
Returns a value between BearWare.SoundLevel.SOUND_VU_MIN and BearWare.SoundLevel.SOUND_VU_MAX

Definition at line 5131 of file TeamTalk.cs.

◆ SetSoundInputGainLevel()

bool BearWare.TeamTalkBase.SetSoundInputGainLevel ( int  nLevel)

Set voice gaining of recorded audio.

The gain level ranges from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX where BearWare.SoundLevel.SOUND_GAIN_DEFAULT is no gain. So 100 is 1/10 of the original volume and 8000 is 8 times the original volume.

Note that using TeamTalkBase.SetSoundInputPreprocess() will override settings on input gain level. This is because automatic gain control will adjust the volume level.

Parameters
nLevelA value from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX.
See also
TeamTalkBase.GetSoundInputGainLevel

Definition at line 5150 of file TeamTalk.cs.

◆ GetSoundInputGainLevel()

int BearWare.TeamTalkBase.GetSoundInputGainLevel ( )

Get voice gain level of outgoing audio.

Returns
A value from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX.
See also
SetSoundInputGainLevel

Definition at line 5160 of file TeamTalk.cs.

◆ SetSoundInputPreprocess() [1/2]

bool BearWare.TeamTalkBase.SetSoundInputPreprocess ( SpeexDSP  lpSpeexDSP)

Enable sound preprocessor which should be used for processing audio recorded by the sound input device (voice input).

To ensure common settings for all users in a channel it's possible to use the audiocfg member of BearWare.Channel as shared source for audio settings.

In order for echo cancellation to work best it's important to also enable AGC in the BearWare.SpeexDSP.

Parameters
lpSpeexDSPThe sound preprocessor settings to use. Preferably from the BearWare.Channel's audiocfg member to ensure common settings for all users.
Returns
TRUE on success, FALSE on failure.

Definition at line 5180 of file TeamTalk.cs.

◆ GetSoundInputPreprocess() [1/2]

bool BearWare.TeamTalkBase.GetSoundInputPreprocess ( ref SpeexDSP  lpSpeexDSP)

Get the sound preprocessor settings which are currently in use for recorded sound input device (voice input).

Parameters
lpSpeexDSPA preallocated SpeexDSP which will receive the settings that is currently in effect.
Returns
TRUE on success, FALSE on failure.

Definition at line 5193 of file TeamTalk.cs.

◆ SetSoundInputPreprocess() [2/2]

bool BearWare.TeamTalkBase.SetSoundInputPreprocess ( AudioPreprocessor  lpAudioPreprocessor)

Enable sound preprocessor which should be used for processing audio recorded by the sound input device (voice input).

It is recommended to use the sound device's native echo cancellor, denoising and automatic gain control instead of BearWare.SpeexDSP. Checkout TeamTalkBase.SetSoundDeviceEffects().

Parameters
lpAudioPreprocessorThe sound preprocessor settings to use.
Returns
TRUE on success, FALSE on failure.

Definition at line 5208 of file TeamTalk.cs.

◆ GetSoundInputPreprocess() [2/2]

bool BearWare.TeamTalkBase.GetSoundInputPreprocess ( ref AudioPreprocessor  lpAudioPreprocessor)

Get the sound preprocessor settings which are currently in use for recorded sound input device (voice input).

Parameters
lpAudioPreprocessorA preallocated BearWare.AudioPreprocessor which will receive the settings that is currently in effect.
Returns
TRUE on success, FALSE on failure.

Definition at line 5220 of file TeamTalk.cs.

◆ SetSoundOutputVolume()

bool BearWare.TeamTalkBase.SetSoundOutputVolume ( int  nVolume)

Set master volume.

If still not loud enough use SetUserVolume().

Parameters
nVolumeA value from BearWare.SoundLevel.SOUND_VOLUME_MIN to BearWare.SoundLevel.SOUND_VOLUME_MAX.
See also
TeamTalkBase.SetUserVolume

Definition at line 5231 of file TeamTalk.cs.

◆ GetSoundOutputVolume()

int BearWare.TeamTalkBase.GetSoundOutputVolume ( )

Get master volume.

Returns
Returns the master volume.
See also
BearWare.SoundLevel.SOUND_VOLUME_MAX
BearWare.SoundLevel.SOUND_VOLUME_MIN

Definition at line 5241 of file TeamTalk.cs.

◆ SetSoundOutputMute()

bool BearWare.TeamTalkBase.SetSoundOutputMute ( bool  bMuteAll)

Set all users mute.

To stop receiving audio from a user call DoUnsubscribe().

Parameters
bMuteAllWhether to mute or unmute all users.
See also
ClientFlag BearWare.ClientFlag.CLIENT_SNDOUTPUT_MUTE

Definition at line 5252 of file TeamTalk.cs.

◆ Enable3DSoundPositioning()

bool BearWare.TeamTalkBase.Enable3DSoundPositioning ( bool  bEnable)

Enable automatically position users using 3D-sound.

3D sound position requires BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_3DPOSITION.

Note that 3d-sound does not work if sound is running in duplex mode (BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX) or in stereo.

Parameters
bEnableTRUE to enable, otherwise FALSE.
See also
TeamTalkBase.SetUserPosition

Definition at line 5266 of file TeamTalk.cs.

◆ AutoPositionUsers()

bool BearWare.TeamTalkBase.AutoPositionUsers ( )

Automatically position users using 3D-sound.

3D sound position requires BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_3DPOSITION.

Note that 3d-sound does not work if sound is running in duplex mode (BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX) or in stereo.

See also
TeamTalkBase.SetUserPosition

Definition at line 5279 of file TeamTalk.cs.

◆ EnableAudioBlockEvent() [1/2]

bool BearWare.TeamTalkBase.EnableAudioBlockEvent ( int  nUserID,
StreamType  uStreamTypes,
bool  bEnable 
)

Enable/disable access to raw audio from individual users, local microphone input or muxed stream of all users.

With audio callbacks enabled all audio which has been played will be accessible by calling TeamTalkBase.AcquireUserAudioBlock(). Every time a new BearWare.AudioBlock is available the event OnUserAudioBlock() is generated.

Special user IDs can be used to retrieve certain types of audio from the client instance:

Parameters
nUserIDUser ID has different meanings depending on the BearWare.StreamType being passed.

For BearWare.StreamType.STREAMTYPE_VOICE:

When using BearWare.TeamTalkBase.TT_MUXED_USERID as user ID the instance must be in a channel with a configured BearWare.AudioCodec. Alternatively use lpAudioFormat to specify the audio properties.

Parameters
uStreamTypesEither BearWare.StreamType.STREAMTYPE_VOICE, BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO or BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO. For BearWare.TeamTalkBase.TT_MUXED_USERID it's possible to mix BearWare.StreamType so e.g. BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO or'ed with BearWare.StreamType.STREAMTYPE_VOICE) will return an BearWare.AudioBlock where these two stream types have been mixed together.
bEnableWhether to enable the OnUserAudioBlock() event.
See also
TeamTalkBase.AcquireUserAudioBlock()
TeamTalkBase.ReleaseUserAudioBlock()
OnUserAudioBlock()

Definition at line 5347 of file TeamTalk.cs.

◆ EnableAudioBlockEvent() [2/2]

bool BearWare.TeamTalkBase.EnableAudioBlockEvent ( int  nUserID,
StreamType  uStreamTypes,
AudioFormat  lpAudioFormat,
bool  bEnable 
)

Same as TeamTalkBase.EnableAudioBlockEvent() but option to specify audio output format.

When using BearWare.TeamTalkBase.TT_MUXED_USERID as user ID in combination with lpAudioFormat will cause BearWare.AudioBlock to contain 20 msec of audio. If lpAudioFormat is NULL then the instance will use the audio format that is configured in the channel's BearWare.AudioCodec.

Parameters
uStreamTypesEither BearWare.StreamType.STREAMTYPE_VOICE, BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO or BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO. For BearWare.TeamTalkBase.TT_MUXED_USERID it's possible to mix BearWare.StreamType so e.g. BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO or'ed with BearWare.StreamType.STREAMTYPE_VOICE) will return an BearWare.AudioBlock where these two stream types have been mixed together.
nUserIDThe user ID to monitor for audio callback. Pass special user ID BearWare.TeamTalkBase.TT_LOCAL_USERID to monitor local recorded audio prior to encoding/processing. Pass special user ID BearWare.TeamTalkBase.TT_MUXED_USERID to get a single audio stream of all audio that is being played from users.
lpAudioFormatResample audio format from user to this BearWare.AudioFormat. Currently only BearWare.AudioFileFormat.AFF_WAVE_FORMAT is supported. Specify NULL to get original audio format.
bEnableWhether to enable the OnUserAudioBlock() event.
See also
TeamTalkBase.AcquireUserAudioBlock()
TeamTalkBase.ReleaseUserAudioBlock()
ClientEvent.CLIENTEVENT_USER_AUDIOBLOCK

Definition at line 5380 of file TeamTalk.cs.

◆ SetUserVolume()

bool BearWare.TeamTalkBase.SetUserVolume ( int  nUserID,
StreamType  nStreamType,
int  nVolume 
)

Set the volume of a user.

Note that it's a virtual volume which is being set since the master volume affects the user volume.

Parameters
nUserIDThe ID of the user whose volume will be changed.
nStreamTypeThe type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
nVolumeMust be between BearWare.SoundLevel.SOUND_VOLUME_MIN and BearWare.SoundLevel.SOUND_VOLUME_MAX.
See also
SetSoundOutputVolume

Definition at line 7825 of file TeamTalk.cs.

◆ SetUserMute()

bool BearWare.TeamTalkBase.SetUserMute ( int  nUserID,
StreamType  nStreamType,
bool  bMute 
)

Mute a user.

To stop receiving audio from a user call TeamTalkBase.DoUnsubscribe() with BearWare.Subscription.SUBSCRIBE_VOICE.

Parameters
nUserIDThe user ID of the user to mute (or unmute).
nStreamTypeThe type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
bMuteTRUE will mute, FALSE will unmute.
See also
SetSoundOutputMute

Definition at line 7840 of file TeamTalk.cs.

◆ SetUserStoppedPlaybackDelay()

bool BearWare.TeamTalkBase.SetUserStoppedPlaybackDelay ( int  nUserID,
StreamType  nStreamType,
int  nDelayMSec 
)

Set the delay of when a user should no longer be considered as playing audio (either voice or audio from media file).

When a user starts talking the TeamTalkBase.OnUserStateChange() is triggered with uUserState changing. A user will remain in this active state until no packets are received from this user, plus a delay (due to network interruptions). This delay is by default set to 500 msec but can be changed by calling TeamTalkBase.SetUserStoppedTalkingDelay().

See also
GetUserStoppedTalkingDelay

Definition at line 7856 of file TeamTalk.cs.

◆ SetUserJitterControl()

bool BearWare.TeamTalkBase.SetUserJitterControl ( int  nUserID,
StreamType  nStreamType,
JitterConfig  lpJitterConfig 
)

Set the configuration for de-jitter measures for a user.

TeamTalk can add a fixed delay at the start of the playout of a user stream. This delay acts as a buffer to smooth out jittering (non-constant delays) in the reception of network packets. The fixed delay is applied at the start of every new stream, such as a new PTT session. The default fixed delay is zero.

TeamTalk can also apply adaptive jitter buffering where the actual jitter is measured and the delay at the start of a stream is adapted based on those measurements. The adaptive delay will not go below the fixed delay. The parameter nMaxAdaptiveDelayMSec maximizes the total adaptive delay. By default, the adaptive mechanism is OFF

By default, all jitter control is OFF

The result of jitter buffering is that playout frames will get buffered in the playout buffer. Make sure to also size the playout buffer for the expected jitter via TeamTalkBase.SetUserAudioStreamBufferSize()

Parameters
nUserIDThe user ID of the user to apply the configuration to.
nStreamTypeThe type of stream to change, currently only BearWare.StreamType.STREAMTYPE_VOICE is supported. Other types are a no-op.
lpJitterConfigThe jitter buffer configuration.

Definition at line 7887 of file TeamTalk.cs.

◆ GetUserJitterControl()

bool BearWare.TeamTalkBase.GetUserJitterControl ( int  nUserID,
StreamType  nStreamType,
ref JitterConfig  lpJitterConfig 
)

Get the de-jitter configuration for a user.

See also
TeamTakBase.SetUserJitterControl()
Parameters
nUserIDThe user ID of the user to apply the configuration to.
nStreamTypeThe type of stream to change, currently only BearWare.StreamType.STREAMTYPE_VOICE is supported. Other types are a no-op.
lpJitterConfigPointer to an application-provided jitter buffer configuration that will be filled upon return.

Definition at line 7904 of file TeamTalk.cs.

◆ SetUserPosition()

bool BearWare.TeamTalkBase.SetUserPosition ( int  nUserID,
StreamType  nStreamType,
float  x,
float  y,
float  z 
)

Set the position of a user.

3D sound position requires BearWare.SoundDeviceFeature.SOUNDDEVICEFEATURE_3DPOSITION.

This can only be done using DirectSound (BearWare.SoundSystem.SOUNDSYSTEM_DSOUND), a mono channel and with sound duplex mode (BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX) disabled.

Parameters
nUserIDID of user.
nStreamTypeThe type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
xDistance in meters to user (left/right).
yDistance in meters to user (back/forward).
zDistance in meters to user (up/down).

Definition at line 7926 of file TeamTalk.cs.

◆ SetUserStereo()

bool BearWare.TeamTalkBase.SetUserStereo ( int  nUserID,
StreamType  nStreamType,
bool  bLeftSpeaker,
bool  bRightSpeaker 
)

Set whether a user should speak in the left, right or both speakers. This function only works if BearWare.AudioCodec has been set to use stereo.

Parameters
nUserIDID of user.
nStreamTypeThe type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
bLeftSpeakerTRUE if user should be played in left speaker.
bRightSpeakerTRUE if user should be played in right speaker.
See also
GetUserStereo

Definition at line 7942 of file TeamTalk.cs.

◆ SetUserMediaStorageDir() [1/2]

bool BearWare.TeamTalkBase.SetUserMediaStorageDir ( int  nUserID,
string  szFolderPath,
string  szFileNameVars,
AudioFileFormat  uAFF 
)

Store user's audio to disk.

Set the path of where to store audio from a user to disk. Event #OnUserRecordMediaFile is triggered when recording starts/stops.

To stop recording set szFolderPath to an empty string and uAFF to BearWare.AudioFileFormat.AFF_NONE.

To store audio of other channels than the client instance check out the section Spying on Users.

Parameters
nUserIDThe ID of the BearWare.User which should store audio to disk. Pass 0 to store local instance's media stream.
szFolderPathThe path on disk to where files should be stored. This value will be stored in szMediaStorageDir of BearWare.User.
szFileNameVarsThe file name used for audio files can consist of the following variables: %nickname%, %username%, %userid%, %counter%, %starttick% and a specified time based on strftime (google 'strftime' for a description of the format. The default format used by TeamTalk is: '%Y%m%d-%H%M%S #%userid% %username%'. The %counter% variable is a 9 digit integer which is incremented for each audio file. The file extension is automatically appended based on the file type (.wav for BearWare.AudioFileFormat BearWare.AudioFileFormat.AFF_WAVE_FORMAT and .mp3 for AFF_MP3_*_FORMAT). Pass NULL or empty string to revert to default format.
uAFFThe BearWare.AudioFileFormat to use for storing audio files. Passing BearWare.AudioFileFormat BearWare.AudioFileFormat.AFF_NONE will cancel/reset the current recording.
Returns
FALSE if path is invalid, otherwise TRUE.
See also
BearWare.User
OnUserRecordMediaFile

Definition at line 7981 of file TeamTalk.cs.

◆ SetUserMediaStorageDir() [2/2]

bool BearWare.TeamTalkBase.SetUserMediaStorageDir ( int  nUserID,
string  szFolderPath,
string  szFileNameVars,
AudioFileFormat  uAFF,
int  nStopRecordingExtraDelayMSec 
)

Store user's audio to disk.

See also
TT_SetUserMediaStorageDir

This extension has an extra parameter for an aditional delay that will be waited before closing the per-user recording. This allows the recording to still capture all voice of a stream in a single file even if there's heavy network jitter. A recording will always be started if a different stream is received for the user. The delay is added on top of the standard playout delay that can be set via

Note that the delay starts after the last packet was written to the playout and thus the delay is already 'counting' when the jitter-buffered playout is still playing

Only supported for BearWare.StreamType.STREAMTYPE_VOICE.

Parameters
nUserIDSee description in TeamTalkBase.SetUserMediaStorageDir()
szFolderPathSee description in TeamTalkBase.SetUserMediaStorageDir()
szFileNameVarsSee description in TeamTalkBase.SetUserMediaStorageDir()
uAFFSee description in TeamTalkBase.SetUserMediaStorageDir()
nStopRecordingExtraDelayMSecExtra delay before closing the recording file default is 0.
Returns
FALSE if path is invalid, otherwise TRUE.
See also
TeamTalkBase.SetUserMediaStorageDir()

Definition at line 8011 of file TeamTalk.cs.

◆ SetUserAudioStreamBufferSize()

bool BearWare.TeamTalkBase.SetUserAudioStreamBufferSize ( int  nUserID,
StreamType  uStreamType,
int  nMSec 
)

Change the amount of media data which can be buffered in the user's playback queue.

Increasing the media buffer size is especially important when the user is currently streaming a media file using TeamTalkBase.StartStreamingMediaFileToChannel(). Once streaming has finished it is recommended to reset the media buffer, i.e. setting it to zero.

A simple way to notify users that the client instance is streaming a media file is to change the status of the local client instance using TeamTalkBase.DoChangeStatus() or to send a BearWare.TextMessage using TeamTalkBase.DoTextMessage().

Parameters
nUserIDThe ID of the user who should have changed the size of the media buffer.
uStreamTypeThe stream type to apply the buffer for, i.e. either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
nMSecThe number of miliseconds of audio and video which should be allowed to be stored in the media buffer. 2000 - 3000 msec is a good size for a media buffer. Set the media buffer size to 0 msec to reset the media buffer to its default value.

Definition at line 8041 of file TeamTalk.cs.

◆ AcquireUserAudioBlock()

AudioBlock BearWare.TeamTalkBase.AcquireUserAudioBlock ( StreamType  uStreamTypes,
int  nUserID 
)

Extract the raw audio associated with the event TeamTalkBase.OnUserAudioBlock().

To enable access to user's raw audio first call TeamTalkBase.EnableAudioBlockEvent(). Whenever new audio becomes available the event TeamTalkBase.OnUserAudioBlock() is generated and TeamTalkBase.AcquireUserAudioBlock() can be called to extract the audio.

The BearWare.AudioBlock contains shared memory with the local client instance therefore always remember to call TeamTalkBase.ReleaseUserAudioBlock() to release the shared memory.

Parameters
uStreamTypesThe stream type to extract, either BearWare.StreamType.STREAMTYPE_VOICE BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO, BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO.
nUserIDThe user ID to monitor for audio callback. Pass 0 to monitor local audio.
See also
TeamTalkBase.ReleaseUserAudioBlock()
TeamTalkBase.EnableAudioBlockEvent()
TeamTalkBase.OnUserAudioBlock()

Definition at line 8065 of file TeamTalk.cs.

◆ ReleaseUserAudioBlock()

bool BearWare.TeamTalkBase.ReleaseUserAudioBlock ( AudioBlock  lpAudioBlock)

Release the shared memory of an BearWare.AudioBlock.

All BearWare.AudioBlock-structures extracted through TeamTalkBase.AcquireUserAudioBlock() must be released again since they share memory with the local client instance.

Never access lpAudioBlock after releasing its BearWare.AudioBlock. This will cause the application to crash with a memory exception.

See also
TeamTalkBase.AcquireUserAudioBlock()
TeamTalkBase.OnUserAudioBlock()

Definition at line 8090 of file TeamTalk.cs.

Variable Documentation

◆ TT_SAMPLERATES_MAX

const int BearWare.TeamTalkBase.TT_SAMPLERATES_MAX = 16
static

The maximum number of sample rates supported by a BearWare.SoundDevice.

Definition at line 4308 of file TeamTalk.cs.