47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
|
//======================================================================
|
||
|
// tx_audio_proc.h
|
||
|
//
|
||
|
// Classes/functions for processing transmit audio.
|
||
|
//======================================================================
|
||
|
|
||
|
#ifndef __tx_audio_proc_h__
|
||
|
#define __tx_audio_proc_h__
|
||
|
|
||
|
#include <Audio.h>
|
||
|
#include <effect_compressor_fb.h>
|
||
|
|
||
|
class IAudioProcessor
|
||
|
{
|
||
|
public:
|
||
|
virtual ~IAudioProcessor() {}
|
||
|
virtual bool isEnabled() const = 0;
|
||
|
virtual void enable() = 0;
|
||
|
virtual void disable() = 0;
|
||
|
virtual void update() = 0;
|
||
|
};
|
||
|
|
||
|
class SpeechCompressor : public IAudioProcessor
|
||
|
{
|
||
|
public:
|
||
|
SpeechCompressor(AudioEffectCompressor&, AudioAmplifier&, AudioAnalyzeRMS&);
|
||
|
//void config(AudioEffectCompressor*, AudioAnalyzeRMS*);
|
||
|
virtual bool isEnabled() const;
|
||
|
virtual void enable();
|
||
|
virtual void disable();
|
||
|
virtual void update();
|
||
|
|
||
|
private:
|
||
|
AudioEffectCompressor& _compress;
|
||
|
AudioAmplifier& _amp;
|
||
|
AudioAnalyzeRMS& _rms;
|
||
|
float _env = 0.0;
|
||
|
float _alpha = 0.8;
|
||
|
bool _enabled = false;
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|
||
|
//======================================================================
|
||
|
// EOF
|
||
|
//======================================================================
|