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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user