1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Fix incorrect resampling rate when at the end of a sound.

This commit is contained in:
zsilencer
2017-06-29 15:43:40 -06:00
parent b39723a0a8
commit bde3197e79

View File

@@ -350,6 +350,11 @@ namespace OpenRCT2 { namespace Audio
{
sint32 srcSamples = (sint32)(bufferLen / byteRate);
sint32 dstSamples = numSamples;
if (bytesRead != readLength)
{
srcSamples = _format.freq;
dstSamples = _format.freq * (1 / rate);
}
bufferLen = ApplyResample(channel, buffer, srcSamples, dstSamples);
buffer = _effectBuffer.GetData();
}