Fix audio volume and stereo on XAudio backend

#675
This commit is contained in:
Wojciech Figat
2021-12-07 16:05:27 +01:00
parent 1b34b3b63a
commit 660c8ef95c

View File

@@ -813,13 +813,11 @@ void AudioBackendXAudio2::Base_Update()
}
else
{
// Stereo
dsp.DopplerFactor = 1.0f;
// TODO: implement proper matrix setup to convert input channels into output mastering voice
// hardcoded case for mono audio -> stereo speakers
Platform::MemoryClear(dsp.pMatrixCoefficients, sizeof(XAudio2::MatrixCoefficients));
dsp.pMatrixCoefficients[0] = 0.5f;
dsp.pMatrixCoefficients[1] = 0.5f;
dsp.pMatrixCoefficients[0] = 1.0f;
dsp.pMatrixCoefficients[3] = 1.0f;
}
const float frequencyRatio = dopplerFactor * source.Pitch * dsp.DopplerFactor;