mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +02:00
Add HRTF reset()
This commit is contained in:
parent
b02e2c8123
commit
a8f7ff7d8a
1 changed files with 22 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
#define hifi_AudioHRTF_h
|
#define hifi_AudioHRTF_h
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
static const int HRTF_AZIMUTHS = 72; // 360 / 5-degree steps
|
static const int HRTF_AZIMUTHS = 72; // 360 / 5-degree steps
|
||||||
static const int HRTF_TAPS = 64; // minimum-phase FIR coefficients
|
static const int HRTF_TAPS = 64; // minimum-phase FIR coefficients
|
||||||
|
@ -56,6 +57,27 @@ public:
|
||||||
void setGainAdjustment(float gain) { _gainAdjust = HRTF_GAIN * gain; };
|
void setGainAdjustment(float gain) { _gainAdjust = HRTF_GAIN * gain; };
|
||||||
float getGainAdjustment() { return _gainAdjust; }
|
float getGainAdjustment() { return _gainAdjust; }
|
||||||
|
|
||||||
|
// clear internal state, but retain settings
|
||||||
|
void reset() {
|
||||||
|
// FIR history
|
||||||
|
memset(_firState, 0, sizeof(_firState));
|
||||||
|
|
||||||
|
// integer delay history
|
||||||
|
memset(_delayState, 0, sizeof(_delayState));
|
||||||
|
|
||||||
|
// biquad history
|
||||||
|
memset(_bqState, 0, sizeof(_bqState));
|
||||||
|
|
||||||
|
// parameter history
|
||||||
|
_azimuthState = 0.0f;
|
||||||
|
_distanceState = 0.0f;
|
||||||
|
_gainState = 0.0f;
|
||||||
|
|
||||||
|
// _gainAdjust is retained
|
||||||
|
|
||||||
|
_silentState = false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AudioHRTF(const AudioHRTF&) = delete;
|
AudioHRTF(const AudioHRTF&) = delete;
|
||||||
AudioHRTF& operator=(const AudioHRTF&) = delete;
|
AudioHRTF& operator=(const AudioHRTF&) = delete;
|
||||||
|
|
Loading…
Reference in a new issue