diff options
| author | Sam Belliveau <sam.belliveau@gmail.com> | 2026-01-27 18:48:22 -0500 |
|---|---|---|
| committer | Sam Belliveau <sam.belliveau@gmail.com> | 2026-01-27 18:48:22 -0500 |
| commit | 51c8f18b73727afaea0991e10789998eaacbe487 (patch) | |
| tree | 9c9e18748e473af95181164acaf2f7fbcf8b5d82 /Source/Core/AudioCommon/Mixer.cpp | |
| parent | bb7e01167346d0e3e4bab426a7b87968d715ee5e (diff) | |
feat: Add an option to preserve audio pitch when emulation speed changes, integrating it into core configuration and both Qt and Android UIs.
Diffstat (limited to 'Source/Core/AudioCommon/Mixer.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/Mixer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp index eab73fb17c..0d673a9e0d 100644 --- a/Source/Core/AudioCommon/Mixer.cpp +++ b/Source/Core/AudioCommon/Mixer.cpp @@ -71,7 +71,7 @@ void Mixer::MixerFifo::Mix(s16* samples, std::size_t num_samples) static_cast<double>(FIXED_SAMPLE_RATE_DIVIDEND) / m_input_sample_rate_divisor; const double emulation_speed = m_mixer->m_config_emulation_speed; - if (0 < emulation_speed && emulation_speed != 1.0) + if (!m_mixer->m_config_audio_preserve_pitch && 0 < emulation_speed && emulation_speed != 1.0) in_sample_rate *= emulation_speed; const double base = static_cast<double>(1 << GRANULE_FRAC_BITS); @@ -430,6 +430,7 @@ void Mixer::StopLogDSPAudio() void Mixer::RefreshConfig() { m_config_emulation_speed = Config::Get(Config::MAIN_EMULATION_SPEED); + m_config_audio_preserve_pitch = Config::Get(Config::MAIN_AUDIO_PRESERVE_PITCH); m_config_fill_audio_gaps = Config::Get(Config::MAIN_AUDIO_FILL_GAPS); m_config_audio_buffer_ms = Config::Get(Config::MAIN_AUDIO_BUFFER_SIZE); } |
