Twitch SDK (Internal)
Public Member Functions | Private Types | Private Attributes | List of all members
ttv::broadcast::PcmAudioMixer Class Reference

#include <pcmaudiomixer.h>

Public Member Functions

 PcmAudioMixer (uint32_t numChannels, uint32_t numSamplesPerChannelPerPacket)
 
virtual ~PcmAudioMixer ()
 
TTV_ErrorCode SubmitAudioSamples (const int16_t *data, uint64_t startTime, size_t length, float volume)
 
TTV_ErrorCode GetNextPacketTime (uint64_t &nextPacketTime) const
 
TTV_ErrorCode GetPacket (int16_t *buffer, uint64_t &nextPacketTime)
 

Private Types

typedef std::vector< int32_t > buffer_t
 

Private Attributes

uint32_t mNumChannels
 
uint32_t mNumSamplesPerChannelPerPacket
 
buffer_t mMixerBuffer
 
uint64_t mNextPacketTime
 

Detailed Description

Mixes PCM audio samples. This is a simple class with many assumptions. Do not try and use it with more than 2 audio layers.

Member Typedef Documentation

◆ buffer_t

typedef std::vector<int32_t> ttv::broadcast::PcmAudioMixer::buffer_t
private

Constructor & Destructor Documentation

◆ PcmAudioMixer()

ttv::broadcast::PcmAudioMixer::PcmAudioMixer ( uint32_t  numChannels,
uint32_t  numSamplesPerChannelPerPacket 
)

◆ ~PcmAudioMixer()

virtual ttv::broadcast::PcmAudioMixer::~PcmAudioMixer ( )
virtual

Member Function Documentation

◆ GetNextPacketTime()

TTV_ErrorCode ttv::broadcast::PcmAudioMixer::GetNextPacketTime ( uint64_t &  nextPacketTime) const

◆ GetPacket()

TTV_ErrorCode ttv::broadcast::PcmAudioMixer::GetPacket ( int16_t *  buffer,
uint64_t &  nextPacketTime 
)

Retrieves the mixed audio. The size of the returned packet will be the same as the numSamplesPerChannelPerPacket value the class was created with.

◆ SubmitAudioSamples()

TTV_ErrorCode ttv::broadcast::PcmAudioMixer::SubmitAudioSamples ( const int16_t *  data,
uint64_t  startTime,
size_t  length,
float  volume 
)

Member Data Documentation

◆ mMixerBuffer

buffer_t ttv::broadcast::PcmAudioMixer::mMixerBuffer
private

◆ mNextPacketTime

uint64_t ttv::broadcast::PcmAudioMixer::mNextPacketTime
private

◆ mNumChannels

uint32_t ttv::broadcast::PcmAudioMixer::mNumChannels
private

◆ mNumSamplesPerChannelPerPacket

uint32_t ttv::broadcast::PcmAudioMixer::mNumSamplesPerChannelPerPacket
private

The documentation for this class was generated from the following file: