TeamTalk 5 Java DLL: Sound Capture and Playback

TeamTalk 5 Java DLL Version 5.18A

Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
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

enum BearWare.SoundDeviceFeature : uint

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

  lpnInputDeviceID | The ID of the default input device.
  lpnOutputDeviceID | The ID of the default output device.

See also
  TeamTalkBase.InitSoundInputDevice
  TeamTalkBase.InitSoundOutputDevice

Definition at line 4698 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 4707 of file TeamTalk.cs.

## ◆ GetSoundDevices()

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

static

Retrieve list of sound devices for recording and playback.

Parameters

  lpSoundDevices | An output array of BearWare.SoundDevice-structs which will receive the available sound devices.

See also
  TeamTalkBase.GetDefaultSoundDevices
  TeamTalkBase.InitSoundInputDevice
  TeamTalkBase.InitSoundOutputDevice

Definition at line 4721 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 4745 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 4753 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

  nInputDeviceID | Should be the nDeviceID extracted through TeamTalkBase.GetSoundDevices().
  nOutputDeviceID | Should be the nDeviceID extracted through TeamTalkBase.GetSoundDevices().
  nSampleRate | The sample rate the client's recorder should use.
  nChannels | Number of channels to use, i.e. 1 = mono, 2 = stereo.
  bDuplexMode | Both 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

  lpAudioPreprocessor | The preprocessing settings to use, i.e. AGC and denoising properties. Pass NULL to ignore AGC, denoise and AEC.
  lpSoundDeviceEffects | The 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 4792 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 4807 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:

- iOS
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_REMOTEIO
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_VOICEPREPROCESSINGIO
- Android
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_OPENSLES_DEFAULT
- All platforms
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_TEAMTALK_VIRTUAL

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

Parameters

  nInputDeviceID | The nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().

See also
  BearWare.SoundDevice
  GetDefaultSoundDevices
  GetSoundDevices
  CloseSoundInputDevice
  GetSoundInputLevel

Definition at line 4839 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

  nSampleRate | The sample rate to use on the shared device. Must exist in BearWare.SoundDevice's `inputSampleRates`. Pass zero to reset to default behaviour.
  nChannels | The number of channels to use (mono, stereo). Must be less or equals to BearWare.SoundDevice's `nMaxInputChannels`. Pass zero to reset to default behaviour.
  nFrameSize | The 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 4874 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:

- iOS
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_REMOTEIO
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_VOICEPREPROCESSINGIO
- Android
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_OPENSLES_DEFAULT
- All platforms
  - BearWare.SoundDeviceConstants.TT_SOUNDDEVICE_ID_TEAMTALK_VIRTUAL

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

Parameters

  nOutputDeviceID | Should be the nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().

See also
  BearWare.SoundDevice
  TeamTalkBase.GetDefaultSoundDevices
  TeamTalkBase.GetSoundOutputDevices
  TeamTalkBase.CloseSoundOutputDevice

Definition at line 4907 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

  nSampleRate | The sample rate to use on the shared device. Must exist in BearWare.SoundDevice's `outputSampleRates`. Pass zero to reset to default behaviour.
  nChannels | The number of channels to use (mono, stereo). Must be less or equals to BearWare.SoundDevice's `nMaxOutputChannels`. Pass zero to reset to default behaviour.
  nFrameSize | The 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 4941 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:

- BearWare.ClientFlag.CLIENT_SNDINOUTPUT_DUPLEX
- BearWare.ClientFlag.CLIENT_SNDOUTPUT_READY
- BearWare.ClientFlag.CLIENT_SNDINPUT_READY

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

  nInputDeviceID | The nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().
  nOutputDeviceID | The nDeviceID of BearWare.SoundDevice extracted through GetSoundDevices().

See also
  TeamTalkBase.InitSoundInputDevice()
  TeamTalkBase.InitSoundOutputDevice()
  TeamTalkBase.EnableEchoCancellation()
  TeamTalkBase.CloseSoundDuplexDevices()

Definition at line 4978 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 5001 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 5023 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 5033 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():

- BearWare.SoundSystem.SOUNDSYSTEM_OPENSLES_ANDROID
  - Modifying BearWare.SoundDeviceEffects on Android will apply to all active TeamTalkBase instances, i.e. BearWare.SoundDeviceEffects are applied globally.
- BearWare.SoundSystem.SOUNDSYSTEM_WASAPI
  - TeamTalkBase.SetSoundDeviceEffects() must be called prior to TeamTalkBase.InitSoundDuplexDevices(). Sound device effects cannot be used with TeamTalkBase.InitSoundInputDevice() and TeamTalkBase.InitSoundOutputDevice() since Windows needs to know both input and output device upon initialization.

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 5072 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 5080 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 5100 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

  nLevel | A value from BearWare.SoundLevel.SOUND_GAIN_MIN to BearWare.SoundLevel.SOUND_GAIN_MAX.

See also
  TeamTalkBase.GetSoundInputGainLevel

Definition at line 5119 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 5129 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

  lpSpeexDSP | The 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 5149 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

  lpSpeexDSP | A preallocated SpeexDSP which will receive the settings that is currently in effect.

Returns
  TRUE on success, FALSE on failure.

Definition at line 5162 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

  lpAudioPreprocessor | The sound preprocessor settings to use.

Returns
  TRUE on success, FALSE on failure.

Definition at line 5177 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

  lpAudioPreprocessor | A preallocated BearWare.AudioPreprocessor which will receive the settings that is currently in effect.

Returns
  TRUE on success, FALSE on failure.

Definition at line 5189 of file TeamTalk.cs.

## ◆ SetSoundOutputVolume()

bool BearWare.TeamTalkBase.SetSoundOutputVolume | ( | int | nVolume | ) |

Set master volume.

If still not loud enough use SetUserVolume().

Parameters

  nVolume | A value from BearWare.SoundLevel.SOUND_VOLUME_MIN to BearWare.SoundLevel.SOUND_VOLUME_MAX.

See also
  TeamTalkBase.SetUserVolume

Definition at line 5200 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 5210 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

  bMuteAll | Whether to mute or unmute all users.

See also
  ClientFlag BearWare.ClientFlag.CLIENT_SNDOUTPUT_MUTE

Definition at line 5221 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

  bEnable | TRUE to enable, otherwise FALSE.

See also
  TeamTalkBase.SetUserPosition

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

- BearWare.TeamTalkBase.TT_LOCAL_USERID
  - Unprocessed audio from microphone when using BearWare.StreamType.STREAMTYPE_VOICE.
  - Decoded PCM16 when using BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
  - Decoded PCM16 when using BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO from all active local playbacks
    See also
      TeamTalkBase.InitLocalPlayback().
- BearWare.TeamTalkBase.TT_LOCAL_TX_USERID
  - Processed audio from microphone that is transmitted to channel when using BearWare.StreamType.STREAMTYPE_VOICE.
  - Not applicable for all other stream types except BearWare.StreamType.STREAMTYPE_VOICE
- BearWare.TeamTalkBase.TT_MUXED_USERID
  - Decoded PCM16 from all specified audio streams (BearWare.StreamType) mixed into a single stream.

Parameters

  nUserID | User ID has different meanings depending on the BearWare.StreamType being passed.

For BearWare.StreamType.STREAMTYPE_VOICE:

- Pass user ID to receive audio from voice stream.
- Pass special user ID BearWare.TeamTalkBase.TT_LOCAL_USERID for audio callback from local recorded audio prior to encoding/processing.
- Pass special user ID BearWare.TeamTalkBase.TT_MUXED_USERID to receive audio where voice stream has been mixed into the single stream. For BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO:
- Pass user ID to receive audio from media stream.
- Pass BearWare.TeamTalkBase.TT_LOCAL_USERID to receive audio from media file being streamed (transmitted).
  See also
    StartStreamingMediaFileToChannel().
- Pass special user ID BearWare.TeamTalkBase.TT_MUXED_USERID to receive audio where media stream has been mixed into the single stream. For BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO:
- Pass session ID returned by InitLocalPlayback() to receive audio stream from local playback.
- Pass BearWare.TeamTalkBase.TT_LOCAL_USERID to receive audio stream from all local playbacks.
- Pass special user ID BearWare.TeamTalkBase.TT_MUXED_USERID to receive audio where local playback stream has been mixed into the single stream.

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

  uStreamTypes | Either 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.
  bEnable | Whether to enable the OnUserAudioBlock() event.

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

Definition at line 5316 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

  uStreamTypes | Either 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.
  nUserID | The 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.
  lpAudioFormat | Resample audio format from user to this BearWare.AudioFormat. Currently only BearWare.AudioFileFormat.AFF_WAVE_FORMAT is supported. Specify NULL to get original audio format.
  bEnable | Whether to enable the OnUserAudioBlock() event.

See also
  TeamTalkBase.AcquireUserAudioBlock()
  TeamTalkBase.ReleaseUserAudioBlock()
  ClientEvent.CLIENTEVENT_USER_AUDIOBLOCK

Definition at line 5349 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

  nUserID | The ID of the user whose volume will be changed.
  nStreamType | The type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
  nVolume | Must be between BearWare.SoundLevel.SOUND_VOLUME_MIN and BearWare.SoundLevel.SOUND_VOLUME_MAX.

See also
  SetSoundOutputVolume

Definition at line 7791 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

  nUserID | The user ID of the user to mute (or unmute).
  nStreamType | The type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
  bMute | TRUE will mute, FALSE will unmute.

See also
  SetSoundOutputMute

Definition at line 7806 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 7822 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

  nUserID | The user ID of the user to apply the configuration to.
  nStreamType | The type of stream to change, currently only BearWare.StreamType.STREAMTYPE_VOICE is supported. Other types are a no-op.
  lpJitterConfig | The jitter buffer configuration.

Definition at line 7853 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

  nUserID | The user ID of the user to apply the configuration to.
  nStreamType | The type of stream to change, currently only BearWare.StreamType.STREAMTYPE_VOICE is supported. Other types are a no-op.
  lpJitterConfig | Pointer to an application-provided jitter buffer configuration that will be filled upon return.

Definition at line 7870 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

  nUserID | ID of user.
  nStreamType | The type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
  x | Distance in meters to user (left/right).
  y | Distance in meters to user (back/forward).
  z | Distance in meters to user (up/down).

Definition at line 7892 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

  nUserID | ID of user.
  nStreamType | The type of stream to change, either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
  bLeftSpeaker | TRUE if user should be played in left speaker.
  bRightSpeaker | TRUE if user should be played in right speaker.

See also
  GetUserStereo

Definition at line 7908 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

  nUserID | The ID of the BearWare.User which should store audio to disk. Pass 0 to store local instance's media stream.
  szFolderPath | The path on disk to where files should be stored. This value will be stored in szMediaStorageDir of BearWare.User.
  szFileNameVars | The 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.
  uAFF | The 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 7947 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

  nUserID | See description in TeamTalkBase.SetUserMediaStorageDir()
  szFolderPath | See description in TeamTalkBase.SetUserMediaStorageDir()
  szFileNameVars | See description in TeamTalkBase.SetUserMediaStorageDir()
  uAFF | See description in TeamTalkBase.SetUserMediaStorageDir()
  nStopRecordingExtraDelayMSec | Extra delay before closing the recording file default is 0.

Returns
  FALSE if path is invalid, otherwise TRUE.

See also
  TeamTalkBase.SetUserMediaStorageDir()

Definition at line 7977 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

  nUserID | The ID of the user who should have changed the size of the media buffer.
  uStreamType | The stream type to apply the buffer for, i.e. either BearWare.StreamType.STREAMTYPE_VOICE or BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO.
  nMSec | The 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 8007 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

  uStreamTypes | The stream type to extract, either BearWare.StreamType.STREAMTYPE_VOICE BearWare.StreamType.STREAMTYPE_MEDIAFILE_AUDIO, BearWare.StreamType.STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO.
  nUserID | The user ID to monitor for audio callback. Pass 0 to monitor local audio.

See also
  TeamTalkBase.ReleaseUserAudioBlock()
  TeamTalkBase.EnableAudioBlockEvent()
  TeamTalkBase.OnUserAudioBlock()

Definition at line 8031 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 8056 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 4277 of file TeamTalk.cs.