X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Faudio_clip.h;fp=nageru%2Faudio_clip.h;h=c087bdb2caa199035fb8e5f2e58e2d67e1abf574;hb=4c23038d9c18d22a9bfe577244a2d0fc293a7e6a;hp=693dbbd4aa863e141a4ac619ea24e59d10c23f56;hpb=5b1f88aa6f4e44f497e951f572a0fe2987389330;p=nageru diff --git a/nageru/audio_clip.h b/nageru/audio_clip.h index 693dbbd..c087bdb 100644 --- a/nageru/audio_clip.h +++ b/nageru/audio_clip.h @@ -22,6 +22,12 @@ public: // Only valid if not empty. std::chrono::steady_clock::time_point get_first_sample() const; + struct BestCorrelation { + float delay_ms; // Positive values means this clip is delayed compared to the reference. + float correlation; // Between -1 and +1 (+1 is a perfect match, -1 is a perfect inversion). + }; + BestCorrelation find_best_correlation(const AudioClip *reference) const; + std::unique_ptr[]> get_min_max_peaks(unsigned width, std::chrono::steady_clock::time_point base) const; private: