vdr-plugin-softhddevice-drm-gles 1.6.7
audioprocessor.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGLP-3.0-or-later
2
13#ifndef __AUDIOPROCESSOR_H
14#define __AUDIOPROCESSOR_H
15
16#include <cstdint>
17#include <string>
18
25public:
26 cAudioProcessor(const int);
27
28 void Normalize(uint16_t *, int);
29 void SetNormalizer(int);
30 void ResetNormalizer(void);
31
32 void Compress(uint16_t *, int);
33 void SetCompressor(int);
34 void ResetCompressor(void);
35
36 void SetEqualizer(int[18]);
37 std::string GetEqualizerOptions(void) const;
38
39 void Amplify(int16_t *, int, int);
41
42private:
44
45 // Normalizer
46 constexpr static int NORMALIZE_MAX_INDEX = 128;
47 constexpr static int NORMALIZE_SAMPLES = 4096;
48 constexpr static int NORMALIZE_DEFAULT_FACTOR = 1000;
49 constexpr static int NORMALIZE_MIN_FACTOR = 100;
56
57 // Compressor
58 constexpr static int COMPRESSION_DEFAULT_FACTOR = 1000;
59 constexpr static int COMPRESSION_DEFAULT_MAX_FACTOR = 2000;
62
63 // Equalizer
64 float m_equalizerBand[18];
65
66 // Amplifier
68};
69
70#endif
Audio Manipulation.
static constexpr int COMPRESSION_DEFAULT_FACTOR
default compression factor
void SetNormalizer(int)
Set normalize volume parameters.
void ResetNormalizer(void)
void Normalize(uint16_t *, int)
Normalize audio samples.
int m_normalizeIndex
index into normalize average table
int m_amplifier
software volume amplify factor
static constexpr int NORMALIZE_MAX_INDEX
number of normalize average samples
void SetEqualizer(int[18])
Set equalizer bands.
float m_equalizerBand[18]
equalizer band
int m_normalizeReady
index normalize counter
int m_compressionFactor
current compression factor
static constexpr int NORMALIZE_DEFAULT_FACTOR
default normalize factor
int m_normalizeMaxFactor
max. normalize factor
int m_compressionMaxFactor
max. compression factor
std::string GetEqualizerOptions(void) const
Get equalizer filter options.
void SetAmplifier(int volume)
const int m_bytesPerSample
uint32_t m_normalizeAverage[NORMALIZE_MAX_INDEX]
average of n last normalize sample blocks
int m_normalizeFactor
current normalize factor
int m_normalizeCounter
normalize sample counter
void Amplify(int16_t *, int, int)
Amplify the samples in software.
static constexpr int COMPRESSION_DEFAULT_MAX_FACTOR
default compression max. factor
void SetCompressor(int)
Set volume compression parameters.
static constexpr int NORMALIZE_SAMPLES
number of normalize samples
void Compress(uint16_t *, int)
Compress audio samples.
static constexpr int NORMALIZE_MIN_FACTOR
min. normalize factor
void ResetCompressor(void)