Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
Framer< T > Class Template Reference

Utility class to re-frame audio packets. More...

Public Member Functions

 Framer (int frameSize)
 Create new Framer instance. More...
 
int count (int bufLen) const
 Gets the number of frames available after adding bufLen samples. More...
 
void frame (const Buffer< T > &buf, void *opaque, void(*op)(void *, const Buffer< T > &))
 Appends the provided buffer to any preexistent samples from a previous call (if any), frames the result of the addition and calls the provided callback once for each full frame, until there are not enough remaining samples to fill a complete frame, then stores any remaining samples for the next call. More...
 

Detailed Description

template<typename T>
class ExitGames::Voice::Framer< T >

Utility class to re-frame audio packets.

Constructor & Destructor Documentation

◆ Framer()

Framer ( int  frameSize)

Create new Framer instance.

Member Function Documentation

◆ count()

int count ( int  bufLen) const

Gets the number of frames available after adding bufLen samples.

Parameters
bufLenNumber of samples that would be added.
Returns
Number of full frames available when adding bufLen samples.

◆ frame()

void frame ( const Buffer< T > &  buf,
void *  opaque,
void(*)(void *, const Buffer< T > &)  op 
)

Appends the provided buffer to any preexistent samples from a previous call (if any), frames the result of the addition and calls the provided callback once for each full frame, until there are not enough remaining samples to fill a complete frame, then stores any remaining samples for the next call.

Parameters
bufArray of samples to add.
opaqueA pointer to custom data that should be forwarded to the callback.
opThe callback to call.