SOUND4 IMPACT.CL Library [1.3.15]
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sound4::impact::dyn::CAudioConverter Class Reference

Audio converter helper. More...

#include <sound4.impact.cl_dyn.hpp>

Public Member Functions

 CAudioConverter (CDynLib &dynlib)
 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, impact_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 1590 of file sound4.impact.cl_dyn.hpp.

Constructor & Destructor Documentation

◆ CAudioConverter()

sound4::impact::dyn::CAudioConverter::CAudioConverter ( CDynLib dynlib)
inline
Parameters
dynlibthe processor dynamic library

Definition at line 1597 of file sound4.impact.cl_dyn.hpp.

◆ ~CAudioConverter()

virtual sound4::impact::dyn::CAudioConverter::~CAudioConverter ( )
inlinevirtual

Definition at line 1604 of file sound4.impact.cl_dyn.hpp.

Member Function Documentation

◆ Configure()

bool sound4::impact::dyn::CAudioConverter::Configure ( SampleFormat  fmt,
size_t  nFrame,
size_t  payl_ch,
size_t  payl_ch_offset,
impact_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 <= (payload_channels-output_channels)]
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 1624 of file sound4.impact.cl_dyn.hpp.

◆ ConvertFrom()

void sound4::impact::dyn::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 1648 of file sound4.impact.cl_dyn.hpp.

◆ ConvertTo()

void sound4::impact::dyn::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 1659 of file sound4.impact.cl_dyn.hpp.

◆ Delete()

void sound4::impact::dyn::CAudioConverter::Delete ( )
inline

Definition at line 1631 of file sound4.impact.cl_dyn.hpp.

◆ IsOK()

bool sound4::impact::dyn::CAudioConverter::IsOK ( ) const
inline

Definition at line 1638 of file sound4.impact.cl_dyn.hpp.


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