mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 06:43:41 +02:00
add hrtf adjustment to throttle gain appx
This commit is contained in:
parent
7bcf136dc9
commit
c4190ad4c4
1 changed files with 4 additions and 0 deletions
|
@ -162,6 +162,10 @@ bool AudioMixerSlave::prepareMix(const SharedNodePointer& listener) {
|
|||
glm::vec3 relativePosition = nodeStream->getPosition() - listenerAudioStream->getPosition();
|
||||
float gain = approximateGain(*listenerAudioStream, *nodeStream, relativePosition);
|
||||
|
||||
// modify by hrtf gain adjustment
|
||||
auto& hrtf = listenerData->hrtfForStream(nodeID, nodeStream->getStreamIdentifier());
|
||||
gain *= hrtf.getGainAdjustment();
|
||||
|
||||
auto streamVolume = nodeStream->getLastPopOutputTrailingLoudness() * gain;
|
||||
nodeVolume = std::max(streamVolume, nodeVolume);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue