HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
normalizes the audio data at the provided amplitude. More...
#include <Normalizer.h>
Public Member Functions | |
Normalizer () | |
Normalizer (heph_audio_sample_t peakAmplitude) | |
Normalizer (heph_audio_sample_t peakAmplitude, double smoothingFactor) | |
virtual | ~Normalizer ()=default |
virtual std::string | Name () const override |
virtual heph_audio_sample_t | GetPeakAmplitude () const |
virtual void | SetPeakAmplitude (heph_audio_sample_t peakAmplitude) |
virtual double | GetSmoothingFactor () const |
virtual void | SetSmoothingFactor (double smoothingFactor) |
Public Member Functions inherited from HephAudio::AudioEffect | |
virtual | ~AudioEffect ()=default |
virtual bool | HasMTSupport () const |
virtual bool | HasRTSupport () const |
virtual size_t | GetThreadCount () const |
virtual void | SetThreadCount (size_t threadCount) |
virtual size_t | CalculateRequiredFrameCount (size_t outputFrameCount, const AudioFormatInfo &formatInfo) const |
virtual size_t | CalculateOutputFrameCount (const AudioBuffer &buffer) const |
virtual void | Process (AudioBuffer &buffer) |
virtual void | Process (AudioBuffer &buffer, size_t startIndex) |
virtual void | Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) |
Protected Member Functions | |
virtual void | ProcessST (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override |
Protected Member Functions inherited from HephAudio::AudioEffect | |
AudioEffect () | |
virtual void | ProcessMT (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) |
Protected Attributes | |
heph_audio_sample_t | peakAmplitude |
heph_audio_sample_t | globalMaxSample |
double | lastGain |
double | smoothingFactor |
std::mutex | mutex |
std::condition_variable | cv |
size_t | threadsCompleted |
Protected Attributes inherited from HephAudio::AudioEffect | |
size_t | threadCount |
normalizes the audio data at the provided amplitude.
HephAudio::Normalizer::Normalizer | ( | ) |
creates a new instance and initializes it with default values.
|
explicit |
creates a new instance and initializes it with the provided values.
peakAmplitude | maximum amplitude of the output signal. |
HephAudio::Normalizer::Normalizer | ( | heph_audio_sample_t | peakAmplitude, |
double | smoothingFactor ) |
creates a new instance and initializes it with the provided values.
peakAmplitude | maximum amplitude of the output signal. |
smoothingFactor | factor for smoothing the gain transition. In the range of [0, 1) where 0 means no smoothing is applied. |
|
virtualdefault |
releases the resources and destroys the instance.
|
overridevirtual |
gets the name of the audio effect.
Implements HephAudio::AudioEffect.
|
virtual |
gets the peak amplitude
|
virtual |
sets the peak amplitude.
peakAmplitude | maximum amplitude of the output signal. |
|
virtual |
gets the smoothing factor.
|
virtual |
sets the smoothing factor.
smoothingFactor | factor for smoothing the gain transition. In the range of [0, 1) where 0 means no smoothing is applied. |
|
overrideprotectedvirtual |
applies the effect using single thread.
inputBuffer | contains the dry data. |
outputBuffer | contains the wet data. |
startIndex | index of the first sample to process. |
frameCount | number of frames to process. |
Implements HephAudio::AudioEffect.
|
protected |
maximum amplitude of the output signal.
|
protected |
the maximum sample the input buffer contains.
|
protected |
last gain for smooth transition.
|
protected |
factor for smoothing the gain transition. In the range of [0, 1) where 0 means no smoothing is applied.
|
protected |
for editing the globalMaxSample.
|
protected |
for waiting all threads to finish updating the globalMaxSample.
|
protected |
number of threads completed updating the globalMaxSample.