mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 17:03:43 +02:00
Support per-avatar gain adjustment on stereo input streams
This commit is contained in:
parent
c27971eeed
commit
48ddfb09c2
1 changed files with 5 additions and 0 deletions
|
@ -322,6 +322,11 @@ void AudioMixerSlave::addStream(AudioMixerClientData& listenerNodeData, const QU
|
|||
|
||||
// stereo sources are not passed through HRTF
|
||||
if (streamToAdd.isStereo()) {
|
||||
|
||||
// apply the avatar gain adjustment
|
||||
auto& hrtf = listenerNodeData.hrtfForStream(sourceNodeID, streamToAdd.getStreamIdentifier());
|
||||
gain *= hrtf.getGainAdjustment();
|
||||
|
||||
for (int i = 0; i < AudioConstants::NETWORK_FRAME_SAMPLES_STEREO; ++i) {
|
||||
_mixSamples[i] += float(streamPopOutput[i] * gain / AudioConstants::MAX_SAMPLE_VALUE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue