From ed402ccef1cf7c6800597750a07acfdc1cbe465c Mon Sep 17 00:00:00 2001 From: AuraSpecs Date: Mon, 15 May 2023 19:42:15 +0200 Subject: [PATCH] Upgrade sound engine to support 44100hz sample rate (#20200) * Upgrade sound engine to support 44100hz. * Increase audio output buffer size to 4096. --- distribution/changelog.txt | 1 + src/openrct2-ui/audio/AudioMixer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 7baee58a37..c4600d5484 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.6 (in development) ------------------------------------------------------------------------ +- Improved: [#20200] Allow audio files to play to up to 44100hz sample rate (from 22050hz). - Change: [#20110] Fix a few RCT1 build height parity discrepancies. - Fix: [#19823] Parkobj, disallow overriding objects of different object types. diff --git a/src/openrct2-ui/audio/AudioMixer.cpp b/src/openrct2-ui/audio/AudioMixer.cpp index 950a904161..3cf692847f 100644 --- a/src/openrct2-ui/audio/AudioMixer.cpp +++ b/src/openrct2-ui/audio/AudioMixer.cpp @@ -27,10 +27,10 @@ void AudioMixer::Init(const char* device) Close(); SDL_AudioSpec want = {}; - want.freq = 22050; + want.freq = 44100; want.format = AUDIO_S16SYS; want.channels = 2; - want.samples = 2048; + want.samples = 4096; want.callback = [](void* arg, uint8_t* dst, int32_t length) -> void { auto* mixer = static_cast(arg); mixer->GetNextAudioChunk(dst, static_cast(length));