diff options
author | Chris Robinson <[email protected]> | 2022-11-12 23:41:11 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-11-12 23:41:11 -0800 |
commit | 2f2d3c33aaa3014a134a29488842e0f1da5a6129 (patch) | |
tree | e5bf2794954c4d2f3b859adbfb8f45605f9918d1 | |
parent | 936f7d8401a8bcc08b514ff01a68b0f14df24819 (diff) |
Add a config option to prevent WASAPI from using a resampler
-rw-r--r-- | alc/backends/wasapi.cpp | 6 | ||||
-rw-r--r-- | alsoftrc.sample | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index f378ad6a..6bbc4439 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -57,6 +57,7 @@ #include <vector> #include "albit.h" +#include "alc/alconfig.h" #include "alnumeric.h" #include "comptr.h" #include "core/converter.h" @@ -1054,7 +1055,10 @@ HRESULT WasapiPlayback::resetProxy() CoTaskMemFree(wfx); wfx = nullptr; - mDevice->Frequency = minu(mDevice->Frequency, mFormat.Format.nSamplesPerSec); + if(!GetConfigValueBool(mDevice->DeviceName.c_str(), "wasapi", "allow-resampler", true)) + mDevice->Frequency = mFormat.Format.nSamplesPerSec; + else + mDevice->Frequency = minu(mDevice->Frequency, mFormat.Format.nSamplesPerSec); const uint32_t chancount{OutputType.Format.nChannels}; const DWORD chanmask{OutputType.dwChannelMask}; diff --git a/alsoftrc.sample b/alsoftrc.sample index d575adc3..230cb9b0 100644 --- a/alsoftrc.sample +++ b/alsoftrc.sample @@ -567,6 +567,14 @@ ## [wasapi] +## allow-resampler: +# Specifies whether to allow an extra resampler pass on the output. Enabling +# this will allow the playback device to be set to a different sample rate +# than the actual output can accept, causing the backend to apply its own +# resampling pass after OpenAL Soft mixes the sources and processes effects +# for output. +#allow-resampler = true + ## ## DirectSound backend stuff ## |