diff options
author | Chris Robinson <[email protected]> | 2019-11-28 14:53:13 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-11-28 14:53:13 -0800 |
commit | 6069eef94daa2c033f5f785274764e3db2605f6f (patch) | |
tree | af9543565a06f1ef12e93cfb92c791474df59ec4 /alc | |
parent | 846a9979567ac9033ccb5ca96f683b21555b2708 (diff) |
Also scale the HRTF delays for different rates
Diffstat (limited to 'alc')
-rw-r--r-- | alc/hrtf.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp index 1b3c47e3..041451bb 100644 --- a/alc/hrtf.cpp +++ b/alc/hrtf.cpp @@ -1368,6 +1368,11 @@ HrtfStore *GetLoadedHrtf(const std::string &name, const char *devname, const ALu for(size_t k{0};k < HRIR_LENGTH;++k) coeffs[k][j] = static_cast<float>(inout[1][k]); } + + ALubyte (&delays)[2] = const_cast<ALubyte(&)[2]>(hrtf->delays[i]); + for(size_t j{0};j < 2;++j) + delays[j] = static_cast<ALubyte>(minu(MAX_HRIR_DELAY, + (delays[j]*devrate + hrtf->sampleRate/2) / hrtf->sampleRate)); } /* Scale the IR size for the new sample rate and update the stored |