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
RmsNormalizer.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{
15 {
16 protected:
21 double targetRms;
22
27 double currentRms;
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 ~RmsNormalizer() = default;
83
84 virtual std::string Name() const override;
85
90 virtual double GetTargetRms() const;
91
98 virtual void SetTargetRms(double targetRms);
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 RMS.
Definition RmsNormalizer.h:15
RmsNormalizer(heph_audio_sample_t peakAmplitude, double smoothingFactor)
double lastGain
Definition RmsNormalizer.h:33
virtual std::string Name() const override
virtual void ProcessST(const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override
RmsNormalizer(heph_audio_sample_t targetRms)
virtual void SetTargetRms(double targetRms)
virtual double GetTargetRms() const
size_t threadsCompleted
Definition RmsNormalizer.h:58
double currentRms
Definition RmsNormalizer.h:27
virtual ~RmsNormalizer()=default
virtual void SetSmoothingFactor(double smoothingFactor)
std::condition_variable cv
Definition RmsNormalizer.h:52
virtual double GetSmoothingFactor() const
double targetRms
Definition RmsNormalizer.h:21
double smoothingFactor
Definition RmsNormalizer.h:40
std::mutex mutex
Definition RmsNormalizer.h:46