mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:12:53 +02:00
CR feedback
This commit is contained in:
parent
537e54e9d4
commit
2593d224c5
1 changed files with 8 additions and 3 deletions
|
@ -327,9 +327,11 @@ void AudioMixerSlave::addStream(AudioMixerClientData& listenerNodeData, const QU
|
||||||
auto& hrtf = listenerNodeData.hrtfForStream(sourceNodeID, streamToAdd.getStreamIdentifier());
|
auto& hrtf = listenerNodeData.hrtfForStream(sourceNodeID, streamToAdd.getStreamIdentifier());
|
||||||
gain *= hrtf.getGainAdjustment();
|
gain *= hrtf.getGainAdjustment();
|
||||||
|
|
||||||
|
const float scale = 1/32768.0f; // int16_t to float
|
||||||
|
|
||||||
for (int i = 0; i < AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; i++) {
|
for (int i = 0; i < AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; i++) {
|
||||||
_mixSamples[2*i+0] += (float)streamPopOutput[2*i+0] * gain * (1/32768.0f);
|
_mixSamples[2*i+0] += (float)streamPopOutput[2*i+0] * gain * scale;
|
||||||
_mixSamples[2*i+1] += (float)streamPopOutput[2*i+1] * gain * (1/32768.0f);
|
_mixSamples[2*i+1] += (float)streamPopOutput[2*i+1] * gain * scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
++stats.manualStereoMixes;
|
++stats.manualStereoMixes;
|
||||||
|
@ -338,8 +340,11 @@ void AudioMixerSlave::addStream(AudioMixerClientData& listenerNodeData, const QU
|
||||||
|
|
||||||
// echo sources are not passed through HRTF
|
// echo sources are not passed through HRTF
|
||||||
if (isEcho) {
|
if (isEcho) {
|
||||||
|
|
||||||
|
const float scale = 1/32768.0f; // int16_t to float
|
||||||
|
|
||||||
for (int i = 0; i < AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; i++) {
|
for (int i = 0; i < AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; i++) {
|
||||||
float sample = (float)streamPopOutput[i] * gain * (1/32768.0f);
|
float sample = (float)streamPopOutput[i] * gain * scale;
|
||||||
_mixSamples[2*i+0] += sample;
|
_mixSamples[2*i+0] += sample;
|
||||||
_mixSamples[2*i+1] += sample;
|
_mixSamples[2*i+1] += sample;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue