Audacity 3.2.0
StftFrameProvider.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 StftFrameProvider.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
13#include <vector>
14#include "PowerSpectrumGetter.h"
15
16namespace MIR
17{
18class MirAudioReader;
19
28class MUSIC_INFORMATION_RETRIEVAL_API StftFrameProvider
29{
30public:
31 StftFrameProvider(const MirAudioReader& source);
32 bool GetNextFrame(PffftFloatVector& frame);
33 int GetNumFrames() const;
34 int GetSampleRate() const;
35 double GetFrameRate() const;
36 int GetFftSize() const;
37
38private:
40 const int mFftSize;
41 const double mHopSize;
42 const std::vector<float> mWindow;
43 const int mNumFrames;
44 const long long mNumSamples;
45 int mNumFramesProvided = 0;
46};
47} // namespace MIR
const long long mNumSamples
const MirAudioReader & mAudio
const std::vector< float > mWindow
int GetFftSize(int sampleRate, bool formantPreservationOn)
A vector of floats guaranteeing alignment as demanded by pffft.