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

Audio converter helper. More...

#include <sound4cl.hpp>

Public Member Functions

 CAudioConverter (CProcessor &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, 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 1586 of file sound4cl.hpp.

Constructor & Destructor Documentation

◆ CAudioConverter()

sound4::CAudioConverter::CAudioConverter ( CProcessor dynlib)
inline
Parameters
dynlibthe processor dynamic library

Definition at line 1593 of file sound4cl.hpp.

◆ ~CAudioConverter()

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

Definition at line 1600 of file sound4cl.hpp.

Member Function Documentation

◆ Configure()

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

Configure the converter.

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 1620 of file sound4cl.hpp.

◆ ConvertFrom()

void sound4::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 1644 of file sound4cl.hpp.

◆ ConvertTo()

void sound4::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 1655 of file sound4cl.hpp.

◆ Delete()

void sound4::CAudioConverter::Delete ( )
inline

Definition at line 1627 of file sound4cl.hpp.

◆ IsOK()

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

Definition at line 1634 of file sound4cl.hpp.


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