TeamTalk 5 .NET DLL  Version 5.11A
BearWare.AudioBlock Struct Reference

An audio block containing the raw audio from a user who was talking. More...

Public Attributes

int nStreamID
 The ID of the stream. The stream id changes every time the user enables a new transmission using TeamTalkBase.EnableTransmission() or through voice activation. More...
 
int nSampleRate
 The sample rate of the raw audio. More...
 
int nChannels
 The number of channels used (1 for mono, 2 for stereo). More...
 
System.IntPtr lpRawAudio
 The raw audio in 16-bit integer format array. The size of the array in bytes is sizeof(short) * nSamples * nChannels. More...
 
int nSamples
 The number of samples in the raw audio array. More...
 
uint uSampleIndex
 The index of the first sample in lpRawAudio. Its value will be a multiple of nSamples. The sample index can be used to detect overflows of the internal buffer. When a user initially starts talking the nSampleIndex will be 0 and while the user is talking nSampleIndex will be greater than 0. When the user stops talking nSampleIndex will be reset to 0 again. More...
 
StreamType uStreamTypes
 The stream types used to generate the AudioBlock's raw audio. More...
 

Detailed Description

An audio block containing the raw audio from a user who was talking.

To enable audio blocks first call TeamTalkBase.EnableAudioBlockEvent() then whenever new audio is played the event TeamTalkBase.OnUserAudioBlock() is generated. Use TeamTalkBase.AcquireUserAudioBlock() to retrieve the audio block.

Note that each user is limited to 128 kbytes of audio data.

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

Definition at line 471 of file TeamTalk.cs.

Member Data Documentation

◆ nStreamID

int BearWare.AudioBlock.nStreamID

The ID of the stream. The stream id changes every time the user enables a new transmission using TeamTalkBase.EnableTransmission() or through voice activation.

Definition at line 476 of file TeamTalk.cs.

◆ nSampleRate

int BearWare.AudioBlock.nSampleRate

The sample rate of the raw audio.

Definition at line 478 of file TeamTalk.cs.

◆ nChannels

int BearWare.AudioBlock.nChannels

The number of channels used (1 for mono, 2 for stereo).

Definition at line 480 of file TeamTalk.cs.

◆ lpRawAudio

System.IntPtr BearWare.AudioBlock.lpRawAudio

The raw audio in 16-bit integer format array. The size of the array in bytes is sizeof(short) * nSamples * nChannels.

Definition at line 484 of file TeamTalk.cs.

◆ nSamples

int BearWare.AudioBlock.nSamples

The number of samples in the raw audio array.

Definition at line 486 of file TeamTalk.cs.

◆ uSampleIndex

uint BearWare.AudioBlock.uSampleIndex

The index of the first sample in lpRawAudio. Its value will be a multiple of nSamples. The sample index can be used to detect overflows of the internal buffer. When a user initially starts talking the nSampleIndex will be 0 and while the user is talking nSampleIndex will be greater than 0. When the user stops talking nSampleIndex will be reset to 0 again.

Definition at line 494 of file TeamTalk.cs.

◆ uStreamTypes

StreamType BearWare.AudioBlock.uStreamTypes

The stream types used to generate the AudioBlock's raw audio.

When retrieving audio that has been mixed together from multiple sources it can be useful to know what stream types were mixed together to generate the AudioBlock.

If 'uStreamTypes' is StreamType.STREAMTYPE_NONE it means that silence was inserted. Silence is inserted if no audio was available for mixing or the duration from last audio packet was received and until nStoppedDelayVoice of BearWare.User has expired.

See also
BearWare.TeamTalkBase.TT_MUXED_USERID

Definition at line 507 of file TeamTalk.cs.