Fix mono audio playback with XAudio2

This commit is contained in:
Wojtek Figat
2021-12-12 12:51:08 +01:00
parent 83046494a5
commit 224b9b8930

View File

@@ -817,7 +817,14 @@ void AudioBackendXAudio2::Base_Update()
dsp.DopplerFactor = 1.0f;
Platform::MemoryClear(dsp.pMatrixCoefficients, sizeof(XAudio2::MatrixCoefficients));
dsp.pMatrixCoefficients[0] = 1.0f;
dsp.pMatrixCoefficients[3] = 1.0f;
if (source.Format.nChannels == 1)
{
dsp.pMatrixCoefficients[1] = 1.0f;
}
else
{
dsp.pMatrixCoefficients[3] = 1.0f;
}
}
const float frequencyRatio = dopplerFactor * source.Pitch * dsp.DopplerFactor;