HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
Normalizer.h
Go to the documentation of this file.
1#pragma once
2#include "HephAudioShared.h"
3#include "AudioEffect.h"
4#include <mutex>
5#include <condition_variable>
6
9namespace HephAudio
10{
14 class Normalizer : public AudioEffect
15 {
16 protected:
22
28
33 double lastGain;
34
41
46 std::mutex mutex;
47
52 std::condition_variable cv;
53
59
60 public:
63
71
80
82 virtual ~Normalizer() = default;
83
84 virtual std::string Name() const override;
85
91
99
104 virtual double GetSmoothingFactor() const;
105
113
114 protected:
115 virtual void ProcessST(const AudioBuffer& inputBuffer, AudioBuffer& outputBuffer, size_t startIndex, size_t frameCount) override;
116 };
117}
float heph_audio_sample_t
Definition HephAudioShared.h:133
class for storing the audio samples in internal format.
Definition AudioBuffer.h:16
base class for the audio effects.
Definition AudioEffect.h:15
normalizes the audio data at the provided amplitude.
Definition Normalizer.h:15
virtual void ProcessST(const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override
std::mutex mutex
Definition Normalizer.h:46
Normalizer(heph_audio_sample_t peakAmplitude, double smoothingFactor)
double smoothingFactor
Definition Normalizer.h:40
virtual void SetSmoothingFactor(double smoothingFactor)
std::condition_variable cv
Definition Normalizer.h:52
virtual double GetSmoothingFactor() const
heph_audio_sample_t globalMaxSample
Definition Normalizer.h:27
virtual ~Normalizer()=default
virtual std::string Name() const override
virtual void SetPeakAmplitude(heph_audio_sample_t peakAmplitude)
double lastGain
Definition Normalizer.h:33
virtual heph_audio_sample_t GetPeakAmplitude() const
heph_audio_sample_t peakAmplitude
Definition Normalizer.h:21
size_t threadsCompleted
Definition Normalizer.h:58
Normalizer(heph_audio_sample_t peakAmplitude)