diff options
author | Chris Robinson <[email protected]> | 2020-12-26 05:23:08 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-26 05:23:08 -0800 |
commit | 8a86ec8ac5cb9ae1f766bd33893bf2e6729b1025 (patch) | |
tree | 3b6a0463c5d9fb48e0bb87f4317d16102ae06b8b /alc/panning.cpp | |
parent | 5f233a2c24de58fde98e08ad8acb6cfe1803d716 (diff) |
Add a crossover frequency field for the device
Used when upsampling low-order ambisonic signals to higher order. Rather than a
hardcoded 400hz, it ensures a consistent crossover point when an ambdec
configuration is used. It can also allow for an alsoft config option.
Diffstat (limited to 'alc/panning.cpp')
-rw-r--r-- | alc/panning.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp index b9ddd2e8..2da5d490 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -595,6 +595,7 @@ void InitCustomPanning(ALCdevice *device, const bool hqdec, const bool stablize, if(!hqdec && conf->FreqBands != 1) ERR("Basic renderer uses the high-frequency matrix as single-band (xover_freq = %.0fhz)\n", conf->XOverFreq); + device->mXOverFreq = conf->XOverFreq; const ALuint order{(conf->ChanMask > Ambi2OrderMask) ? 3u : (conf->ChanMask > Ambi1OrderMask) ? 2u : 1u}; @@ -813,7 +814,8 @@ void InitHrtfPanning(ALCdevice *device) HrtfStore *Hrtf{device->mHrtf.get()}; auto hrtfstate = DirectHrtfState::Create(count); - hrtfstate->build(Hrtf, device->mIrSize, AmbiPoints, AmbiMatrix, AmbiOrderHFGain); + hrtfstate->build(Hrtf, device->mIrSize, AmbiPoints, AmbiMatrix, device->mXOverFreq, + AmbiOrderHFGain); device->mHrtfState = std::move(hrtfstate); InitNearFieldCtrl(device, Hrtf->field[0].distance, ambi_order, true); @@ -848,6 +850,7 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, HrtfRequestMode hrtf_appreq device->mHrtf = nullptr; device->mIrSize = 0; device->HrtfName.clear(); + device->mXOverFreq = 400.0f; device->mRenderMode = RenderMode::Normal; if(device->FmtChans != DevFmtStereo) |