From a47bda026bf61999d6cecda0297c9154f51b090d Mon Sep 17 00:00:00 2001 From: Oschowa Date: Tue, 9 Feb 2021 13:19:10 +0100 Subject: [PATCH] Audio/AL: Request our default sampling rate (48kHz) from AL when creating the context. Otherwise AL might downsample and output in 44.1kHz unnecessarily, which happens at least on my system. Also tested on an audio device that doesn't support 48kHz to makes sure that still works. --- rpcs3/Emu/Audio/AL/OpenALBackend.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Audio/AL/OpenALBackend.cpp b/rpcs3/Emu/Audio/AL/OpenALBackend.cpp index 6c15cacd13..78820c8fd3 100644 --- a/rpcs3/Emu/Audio/AL/OpenALBackend.cpp +++ b/rpcs3/Emu/Audio/AL/OpenALBackend.cpp @@ -14,10 +14,12 @@ LOG_CHANNEL(OpenAL); OpenALBackend::OpenALBackend() : AudioBackend() { + ALCint attribs[] = {ALC_FREQUENCY, DEFAULT_AUDIO_SAMPLING_RATE, 0, 0}; + ALCdevice* m_device = alcOpenDevice(nullptr); checkForAlcError("alcOpenDevice"); - ALCcontext* m_context = alcCreateContext(m_device, nullptr); + ALCcontext* m_context = alcCreateContext(m_device, attribs); checkForAlcError("alcCreateContext"); alcMakeContextCurrent(m_context);