TeamTalk 5 C-API DLL Version 5.22A

Loading...
Searching...
No Matches
Public Attributes | List of all members
AudioBlock Struct Reference
Sound Capture and Playback

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

`#include <TeamTalk.h>`

## Public Attributes

INT32 | nStreamID
| The ID of the stream. The stream id changes every time the user enables a new transmission using TT_EnableTransmission() or through voice activation.
INT32 | nSampleRate
| The sample rate of the raw audio.
INT32 | nChannels
| The number of channels used (1 for mono, 2 for stereo).
VOID * | lpRawAudio
| The raw audio in 16-bit integer format array. The size of the array in bytes is `sizeof(short)` * `nSamples` * `nChannels`.
INT32 | nSamples
| The number of samples in the raw audio array.
UINT32 | 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.
StreamTypes | uStreamTypes
| The stream types used to generate the AudioBlock's raw audio.

## Detailed Description

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

To enable audio blocks first call TT_EnableAudioBlockEvent() then whenever new audio is played the event CLIENTEVENT_USER_AUDIOBLOCK is generated. Use TT_AcquireUserAudioBlock() to retrieve the audio block.

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

See also
  TT_EnableAudioBlockEvent()
  TT_AcquireUserAudioBlock()
  TT_ReleaseUserAudioBlock()

Definition at line 660 of file TeamTalk.h.

## Member Data Documentation

## ◆ nStreamID

INT32 AudioBlock::nStreamID

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

Definition at line 665 of file TeamTalk.h.

## ◆ nSampleRate

INT32 AudioBlock::nSampleRate

The sample rate of the raw audio.

Definition at line 667 of file TeamTalk.h.

## ◆ nChannels

INT32 AudioBlock::nChannels

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

Definition at line 669 of file TeamTalk.h.

## ◆ lpRawAudio

VOID* 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 673 of file TeamTalk.h.

## ◆ nSamples

INT32 AudioBlock::nSamples

The number of samples in the raw audio array.

Definition at line 675 of file TeamTalk.h.

## ◆ uSampleIndex

UINT32 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 683 of file TeamTalk.h.

## ◆ uStreamTypes

StreamTypes 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_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 User has expired.

See also
  TT_MUXED_USERID

Definition at line 696 of file TeamTalk.h.