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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user