diff options
Diffstat (limited to 'src/audio_core')
-rw-r--r-- | src/audio_core/time_stretch.cpp | 6 |
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); |