Attempt to do a crossfade when changing FFT size, using the same stretchsource instance. It's tricky and not really working yet like this.

This commit is contained in:
xenakios
2017-11-22 00:18:50 +02:00
parent 8890faea01
commit c43de8120c
3 changed files with 67 additions and 16 deletions

View File

@ -123,7 +123,7 @@ private:
int64_t m_maxloops = 0;
std::unique_ptr<WDL_Resampler> m_resampler;
std::vector<double> m_resampler_outbuf;
std::mutex m_mutex;
std::recursive_mutex m_mutex;
std::vector<int> m_specproc_order;
bool m_stop_play_requested = false;
double m_freeze_pos = 0.0;
@ -132,6 +132,11 @@ private:
bool m_clip_output = true;
void initObjects();
AudioFormatManager* m_afm = nullptr;
std::atomic<bool> m_is_crossfading{ false };
AudioBuffer<float> m_crossfadebuffer;
int m_crossfade_requested_len = 8192;
int m_crossfade_len = 0;
int m_crossfade_counter = 0;
};
class MultiStretchAudioSource final : public PositionableAudioSource