SOUND4 x1.CLOUD Library [1.5.6]
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
sound4::CProcessor Class Reference

Dynamic library interface. More...

#include <sound4cl.hpp>

Public Member Functions

 CProcessor ()=default
 
bool Load (const std::filesystem::path &filepath)
 Loads the library.
 
bool IsOk () const
 Check if the library was loaded correctly.
 
void AudioConvertFrom (const uint8_t *payload, float *output, size_t nSpl, SampleFormat fmt)
 
void AudioConvertTo (const float *input, uint8_t *payload, size_t nSpl, SampleFormat fmt)
 
void StereoToMono (const float *input, float *output, size_t nFrame)
 
void MonoToStereo (const float *input, float *output, size_t nFrame)
 
void StereoToMono_Planar (const float *inputL, const float *inputR, float *output, size_t nFrame)
 
void MonoToStereo_Planar (const float *input, float *outputL, float *outputR, size_t nFrame)
 
void AudioMonoFromLiveStereo (const uint8_t *payload, float *output)
 
void AudioMonoToLiveStereo (const float *input, uint8_t *payload)
 
std::string GetVersion ()
 
unsigned int GetChunkSizeInFrames ()
 
std::vector< unsigned int > GetPossibleChunkSizeInFrames ()
 
unsigned int GetChannelCount ()
 
unsigned int GetAudioInputCount ()
 
unsigned int GetAudioOutputCount ()
 
unsigned int GetSampleRate ()
 
std::string GetFormatName (const SampleFormat fmt)
 
SampleFormat GetFormatFromName (const std::string &name)
 
unsigned int GetBytesFromFormat (const SampleFormat fmt)
 
void SetLogSeverity (LogSeverity severity)
 
void SetLoggerCallback (log_cb_t cb)
 

Protected Member Functions

template<typename T >
helper::DynFuncHolder< T > GetPrefixSymbol (const std::string &name)
 

Friends

class CBus
 
class CInstance
 

Detailed Description

Once you loaded the library with Load(), if it succeed you can use all the standard C functions from this library.

Definition at line 299 of file sound4cl.hpp.

Constructor & Destructor Documentation

◆ CProcessor()

sound4::CProcessor::CProcessor ( )
default

Member Function Documentation

◆ GetAudioInputCount()

unsigned int sound4::CProcessor::GetAudioInputCount ( )
inline

Get the number of inputs for this process

Remarks
All inputs have GetChannelCount() channels
Returns
The process input count

Definition at line 753 of file sound4cl.hpp.

◆ GetAudioOutputCount()

unsigned int sound4::CProcessor::GetAudioOutputCount ( )
inline

Get the number of outputs for this process

Remarks
All outputs have GetChannelCount() channels
Returns
The process outputs count

Definition at line 763 of file sound4cl.hpp.

◆ GetBytesFromFormat()

unsigned int sound4::CProcessor::GetBytesFromFormat ( const SampleFormat  fmt)
inline

Get the format byte size

Parameters
fmtthe format
Returns
the number of bytes used by this format for a single channel audio sample

Definition at line 800 of file sound4cl.hpp.

◆ GetChannelCount()

unsigned int sound4::CProcessor::GetChannelCount ( )
inline

Get the number of channels needed by this process

Returns
The process channels count

Definition at line 743 of file sound4cl.hpp.

◆ GetChunkSizeInFrames()

unsigned int sound4::CProcessor::GetChunkSizeInFrames ( )
inline

Get the default number of frames in a process chunk.

The output will be available only by chunks of this size.

Note
A Frame is a set of GetChannelCount samples
Returns
The process chunk size in frame
Deprecated:
Use GetPossibleChunkSizeInFrames

Definition at line 714 of file sound4cl.hpp.

◆ GetFormatFromName()

SampleFormat sound4::CProcessor::GetFormatFromName ( const std::string &  name)
inline

Convert string to format

Parameters
namethe format string
Returns
the matching format, or INVALID_FORMAT if invalid.

Definition at line 791 of file sound4cl.hpp.

◆ GetFormatName()

std::string sound4::CProcessor::GetFormatName ( const SampleFormat  fmt)
inline

Convert format to string

Parameters
fmtthe format
Returns
the string name of the format

Definition at line 782 of file sound4cl.hpp.

◆ GetPossibleChunkSizeInFrames()

std::vector< unsigned int > sound4::CProcessor::GetPossibleChunkSizeInFrames ( )
inline

Get the possibles number of frames in a process chunk.

The output will be available only by chunks of this size.

Note
A Frame is a set of GetChannelCount samples
Returns
An vector of possible process chunk size in frame

Definition at line 725 of file sound4cl.hpp.

◆ GetPrefixSymbol()

template<typename T >
helper::DynFuncHolder< T > sound4::CProcessor::GetPrefixSymbol ( const std::string &  name)
inlineprotected

Definition at line 393 of file sound4cl.hpp.

◆ GetSampleRate()

unsigned int sound4::CProcessor::GetSampleRate ( )
inline

Get the processing sample-rate

Remarks
For now, always return 48000, but should be checked for backward compatibility
Returns
The process sample-rate in Hz

Definition at line 773 of file sound4cl.hpp.

◆ GetVersion()

std::string sound4::CProcessor::GetVersion ( )
inline

Get the process version string

Returns
version string

Definition at line 701 of file sound4cl.hpp.

◆ IsOk()

bool sound4::CProcessor::IsOk ( ) const
inline
Returns
true if OK.
false if not OK.

Definition at line 588 of file sound4cl.hpp.

◆ Load()

bool sound4::CProcessor::Load ( const std::filesystem::path &  filepath)
inline
Parameters
filepaththe path of the library to load.
Returns
true if library was loaded correctly.
false if library load failed. Do not use in this case !

Definition at line 408 of file sound4cl.hpp.

◆ SetLoggerCallback()

void sound4::CProcessor::SetLoggerCallback ( log_cb_t  cb)
inline

Sets the log callback. If not set, console output will be used.

Definition at line 812 of file sound4cl.hpp.

◆ SetLogSeverity()

void sound4::CProcessor::SetLogSeverity ( LogSeverity  severity)
inline

Sets the log severity (global)

Definition at line 806 of file sound4cl.hpp.

Friends And Related Symbol Documentation

◆ CBus

friend class CBus
friend

Definition at line 305 of file sound4cl.hpp.

◆ CInstance

friend class CInstance
friend

Definition at line 306 of file sound4cl.hpp.


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