-
Notifications
You must be signed in to change notification settings - Fork 1
/
TssDetector.h
67 lines (50 loc) · 1.64 KB
/
TssDetector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef _TSSDETECTOR_H_
#define _TSSDETECTOR_H_
#include <vamp-sdk/Plugin.h>
#include <vector>
using std::string;
class TssDetector : public Vamp::Plugin {
public:
TssDetector(float inputSampleRate);
virtual ~TssDetector();
string getIdentifier() const;
string getName() const;
string getDescription() const;
string getMaker() const;
int getPluginVersion() const;
string getCopyright() const;
InputDomain getInputDomain() const;
size_t getPreferredBlockSize() const;
size_t getPreferredStepSize() const;
size_t getMinChannelCount() const;
size_t getMaxChannelCount() const;
ParameterList getParameterDescriptors() const;
float getParameter(string identifier) const;
void setParameter(string identifier, float value);
ProgramList getPrograms() const;
string getCurrentProgram() const;
void selectProgram(string name);
OutputList getOutputDescriptors() const;
bool initialise(size_t channels, size_t stepSize, size_t blockSize);
void reset();
FeatureSet process(const float *const *inputBuffers,
Vamp::RealTime timestamp);
FeatureSet getRemainingFeatures();
protected:
// plugin-specific data and methods go here
int m_blockSize;
float m_sensitivity;
float m_hysterisisFactor;
float m_lowPassWeight;
int m_minFrames;
int m_minFramesLong;
int m_maxShiftDown;
int m_maxShiftUp;
std::vector<float> lowPassBuffer;
int m_consecutiveMatches;
int m_framesSinceSpeech;
int m_framesSinceMatch;
float m_savedOtherBands;
float avgBand(std::vector<float> &frame, size_t low, size_t hi);
};
#endif