SuperpoweredSDK  v2.0.2
Superpowered Audio SDK
SuperpoweredNBandEQ Class Reference

N-band equalizer. More...

#include "OpenSource/SuperpoweredNBandEQ.h"

Inheritance diagram for SuperpoweredNBandEQ:
Collaboration diagram for SuperpoweredNBandEQ:

Public Member Functions

 SuperpoweredNBandEQ (unsigned int samplerate, float *frequencies)
 Constructor. More...
 
 ~SuperpoweredNBandEQ ()
 
float getBandDb (unsigned int index)
 
bool process (float *input, float *output, unsigned int numberOfFrames)
 Processes the audio. More...
 
void setGainDb (unsigned int index, float gainDecibels)
 Sets the gain for a frequency band. More...
 

Public Attributes

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...
 
unsigned int samplerate = 0
 Sample rate in Hz. More...
 

Private Member Functions

 SuperpoweredNBandEQ (const SuperpoweredNBandEQ &)
 
SuperpoweredNBandEQoperator= (const SuperpoweredNBandEQ &)
 

Private Attributes

nbeqInternalsinternals
 

Detailed Description

N-band equalizer.

It doesn't allocate any internal buffers and needs just a few bytes of memory.

Constructor & Destructor Documentation

◆ SuperpoweredNBandEQ() [1/2]

SuperpoweredNBandEQ::SuperpoweredNBandEQ ( unsigned int  samplerate,
float *  frequencies 
)

Constructor.

Enabled is false by default.

Parameters
samplerateThe initial sample rate in Hz.
frequencies0-terminated list of frequency bands.

◆ ~SuperpoweredNBandEQ()

SuperpoweredNBandEQ::~SuperpoweredNBandEQ ( )

◆ SuperpoweredNBandEQ() [2/2]

SuperpoweredNBandEQ::SuperpoweredNBandEQ ( const SuperpoweredNBandEQ )
private

Member Function Documentation

◆ getBandDb()

float SuperpoweredNBandEQ::getBandDb ( unsigned int  index)
Returns
Returns with the gain for a frequency band in decibels.

◆ operator=()

SuperpoweredNBandEQ& SuperpoweredNBandEQ::operator= ( const SuperpoweredNBandEQ )
private

◆ process()

bool SuperpoweredNBandEQ::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 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. Recommendation for best performance: multiply of 4, minimum 64.

Implements Superpowered::FX.

◆ setGainDb()

void SuperpoweredNBandEQ::setGainDb ( unsigned int  index,
float  gainDecibels 
)

Sets the gain for a frequency band.

Parameters
indexThe index of the frequency band.
gainDecibelsThe gain of the frequency band in decibels.

Member Data Documentation

◆ 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

nbeqInternals* SuperpoweredNBandEQ::internals
private

◆ samplerate

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

Sample rate in Hz.


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