add hrtf adjustment to throttle gain appx

This commit is contained in:
Zach Pomerantz 2017-01-27 15:26:49 -05:00
parent 7bcf136dc9
commit c4190ad4c4

View file

@ -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);
}