summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfearlessTobi <thm.frey@gmail.com>2018-10-29 14:49:36 +0100
committerfearlessTobi <thm.frey@gmail.com>2018-10-29 14:49:36 +0100
commit655694253a863666542205858dbf428a614328ab (patch)
tree45395aa40e8239422ddc3feb487d3b4764b07249
parentMerge pull request #1610 from slashiee/dxt1-alpha (diff)
downloadyuzu-655694253a863666542205858dbf428a614328ab.tar
yuzu-655694253a863666542205858dbf428a614328ab.tar.gz
yuzu-655694253a863666542205858dbf428a614328ab.tar.bz2
yuzu-655694253a863666542205858dbf428a614328ab.tar.lz
yuzu-655694253a863666542205858dbf428a614328ab.tar.xz
yuzu-655694253a863666542205858dbf428a614328ab.tar.zst
yuzu-655694253a863666542205858dbf428a614328ab.zip
-rw-r--r--src/audio_core/time_stretch.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/audio_core/time_stretch.cpp b/src/audio_core/time_stretch.cpp
index cee8b12dd..2fe0b3aef 100644
--- a/src/audio_core/time_stretch.cpp
+++ b/src/audio_core/time_stretch.cpp
@@ -32,10 +32,10 @@ std::size_t TimeStretcher::Process(const s16* in, std::size_t num_in, s16* out,
// We were given actual_samples number of samples, and num_samples were requested from us.
double current_ratio = static_cast<double>(num_in) / static_cast<double>(num_out);
- const double max_latency = 1.0; // seconds
+ const double max_latency = 0.25; // seconds
const double max_backlog = m_sample_rate * max_latency;
const double backlog_fullness = m_sound_touch.numSamples() / max_backlog;
- if (backlog_fullness > 5.0) {
+ if (backlog_fullness > 4.0) {
// Too many samples in backlog: Don't push anymore on
num_in = 0;
}
@@ -49,7 +49,7 @@ std::size_t TimeStretcher::Process(const s16* in, std::size_t num_in, s16* out,
// This low-pass filter smoothes out variance in the calculated stretch ratio.
// The time-scale determines how responsive this filter is.
- constexpr double lpf_time_scale = 2.0; // seconds
+ constexpr double lpf_time_scale = 0.712; // seconds
const double lpf_gain = 1.0 - std::exp(-time_delta / lpf_time_scale);
m_stretch_ratio += lpf_gain * (current_ratio - m_stretch_ratio);