SOUND4 x1.CL Library [1.5.13]
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sound4::cloudx1::CAudioConverter Class Reference

Audio converter helper. More...

#include <sound4.x1.cloud.hpp>

Public Member Functions

 CAudioConverter ()=default
 Construct a new empty CAudioConverter object.
 
virtual ~CAudioConverter ()
 Destroy the CAudioConverter object.
 
bool Configure (SampleFormat fmt, size_t nFrame, size_t payl_ch, size_t payl_ch_offset, cloudx1_ConverterTargetMode target_mode)
 
void Delete ()
 
bool IsOK () const
 
void ConvertFrom (const uint8_t *payload, float *output)
 
void ConvertTo (const float *input, uint8_t *payload)
 

Detailed Description

This helps to extract/insert a subset of channels from/to the payload, and convert it to floating-point format.

Definition at line 1108 of file sound4.x1.cloud.hpp.

Constructor & Destructor Documentation

◆ CAudioConverter()

sound4::cloudx1::CAudioConverter::CAudioConverter ( )
default

◆ ~CAudioConverter()

virtual sound4::cloudx1::CAudioConverter::~CAudioConverter ( )
inlinevirtual

Definition at line 1118 of file sound4.x1.cloud.hpp.

Member Function Documentation

◆ Configure()

bool sound4::cloudx1::CAudioConverter::Configure ( SampleFormat  fmt,
size_t  nFrame,
size_t  payl_ch,
size_t  payl_ch_offset,
cloudx1_ConverterTargetMode  target_mode 
)
inline

Prepare an audio converter for extract/insert and convert.

The floating-point channels count depends on target_mode. It can be the same as payload, or fixed to mono or stereo.

Parameters
fmtthe format of the payload
nFramethe number of frames per packet
payl_chthe number of channels in the payload
payl_ch_offsetthe offset of the first channel to extract/insert in the payload [must be <= (payl_ch-proc_ch)]
target_modedefines the number of channels in process, and the number of channels to extract from payload for mono<->stereo conversion
Returns
true if was created
Note
The converter is not multithread-safe, it uses internal cache buffers.

Definition at line 1138 of file sound4.x1.cloud.hpp.

◆ ConvertFrom()

void sound4::cloudx1::CAudioConverter::ConvertFrom ( const uint8_t *  payload,
float *  output 
)
inline

Convert the payload to floating-point array, using a predefined converter.

Warning
Output buffer must be 64-byte aligned
Parameters
payloadthe binary raw audio buffer
outputaudio output buffer (64 byte aligned)

Definition at line 1161 of file sound4.x1.cloud.hpp.

◆ ConvertTo()

void sound4::cloudx1::CAudioConverter::ConvertTo ( const float *  input,
uint8_t *  payload 
)
inline

Convert floating-point array to payload, using a predefined converter.

Warning
Input buffer must be 64-byte aligned
Parameters
inputaudio input buffer (64 byte aligned)
payloadthe binary raw audio buffer

Definition at line 1172 of file sound4.x1.cloud.hpp.

◆ Delete()

void sound4::cloudx1::CAudioConverter::Delete ( )
inline

Definition at line 1144 of file sound4.x1.cloud.hpp.

◆ IsOK()

bool sound4::cloudx1::CAudioConverter::IsOK ( ) const
inline

Definition at line 1151 of file sound4.x1.cloud.hpp.


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