SuperpoweredSDK  v2.0.2
Superpowered Audio SDK
Superpowered::Limiter Class Reference

Limiter with 32 samples latency. More...

#include "SuperpoweredLimiter.h"

Inheritance diagram for Superpowered::Limiter:
Collaboration diagram for Superpowered::Limiter:

Public Member Functions

 Limiter (unsigned int samplerate)
 Constructor. More...
 
 ~Limiter ()
 
float getGainReductionDb ()
 
bool process (float *input, float *output, unsigned int numberOfFrames)
 Processes the audio. More...
 

Public Attributes

float ceilingDb
 Ceiling in decibels, limited between 0 and -40. Default: 0. More...
 
bool enabled = false
 Turns the effect on/off. The actual switch will happen on the next process() call for smooth, audio-artifact free operation. More...
 
float releaseSec
 Release in seconds (not milliseconds!). Limited between 0.1 and 1.6. Default: 0.05 (50 ms). More...
 
unsigned int samplerate = 0
 Sample rate in Hz. More...
 
float thresholdDb
 Threshold in decibels, limited between 0 and -40. Default: 0. More...
 

Private Member Functions

 Limiter (const Limiter &)
 
Limiteroperator= (const Limiter &)
 

Private Attributes

limiterInternals * internals
 

Detailed Description

Limiter with 32 samples latency.

It doesn't allocate any internal buffers and needs less than 1 kb of memory.

Constructor & Destructor Documentation

◆ Limiter() [1/2]

Superpowered::Limiter::Limiter ( unsigned int  samplerate)

Constructor.

Enabled is false by default.

Parameters
samplerateThe initial sample rate in Hz.

◆ ~Limiter()

Superpowered::Limiter::~Limiter ( )

◆ Limiter() [2/2]

Superpowered::Limiter::Limiter ( const Limiter )
private

Member Function Documentation

◆ getGainReductionDb()

float Superpowered::Limiter::getGainReductionDb ( )
Returns
Returns the maximum gain reduction in decibels since the last getGainReductionDb() call.

◆ operator=()

Limiter& Superpowered::Limiter::operator= ( const Limiter )
private

◆ process()

bool Superpowered::Limiter::process ( float *  input,
float *  output,
unsigned int  numberOfFrames 
)
virtual

Processes the audio.

Always call it in the audio processing callback, regardless if the effect is enabled or not for smooth, audio-artifact free operation. It's never blocking for real-time usage. You can change all properties and call getGainReductionDb() on any thread, concurrently with process().

Returns
If process() returns with true, the contents of output are replaced with the audio output. If process() returns with false, the contents of output are not changed.
Parameters
inputPointer to floating point numbers. 32-bit interleaved stereo input.
outputPointer to floating point numbers. 32-bit interleaved stereo output. Can point to the same location with input (in-place processing).
numberOfFramesNumber of frames to process. Recommendations for best performance: multiply of 4, minimum 64.

Implements Superpowered::FX.

Member Data Documentation

◆ ceilingDb

float Superpowered::Limiter::ceilingDb

Ceiling in decibels, limited between 0 and -40. Default: 0.

◆ enabled

bool Superpowered::FX::enabled = false
inherited

Turns the effect on/off. The actual switch will happen on the next process() call for smooth, audio-artifact free operation.

◆ internals

limiterInternals* Superpowered::Limiter::internals
private

◆ releaseSec

float Superpowered::Limiter::releaseSec

Release in seconds (not milliseconds!). Limited between 0.1 and 1.6. Default: 0.05 (50 ms).

◆ samplerate

unsigned int Superpowered::FX::samplerate = 0
inherited

Sample rate in Hz.

◆ thresholdDb

float Superpowered::Limiter::thresholdDb

Threshold in decibels, limited between 0 and -40. Default: 0.


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