mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 01:22:25 +01:00
Fix crackling when resampling audio
This commit is contained in:
committed by
GitHub
parent
140fed1086
commit
7f346d6c45
@@ -13,6 +13,7 @@
|
||||
- Fix: [#25488] Crash in headless mode.
|
||||
- Fix: [#25494] The Go-Karts steep to flat track does not draw correctly in the flat side tunnel.
|
||||
- Fix: [#25518] The virtual floor does not draw correctly if expanded on the positive x and y axes.
|
||||
- Fix: [#25519] Crackling audio when sampling frequencies do not match.
|
||||
- Fix: [objects#401] Round tunnels on down slopes glitch.
|
||||
- Fix: [objects#404] Wooden Wild Mine cars incorrectly allow setting a third remap colour.
|
||||
- Fix: [objects#408] Australian fountain sets have confusing naming.
|
||||
|
||||
@@ -200,7 +200,7 @@ void AudioMixer::MixChannel(ISDLAudioChannel* channel, uint8_t* data, size_t len
|
||||
|
||||
// Read raw PCM from channel
|
||||
int32_t readSamples = numSamples * rate;
|
||||
auto readLength = static_cast<size_t>(readSamples / cvt.len_ratio) * outputByteRate;
|
||||
auto readLength = static_cast<size_t>(ceil(readSamples / cvt.len_ratio)) * outputByteRate;
|
||||
_channelBuffer.resize(readLength);
|
||||
size_t bytesRead = channel->Read(_channelBuffer.data(), readLength);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user