bbc-vamp-plugins  1.0
SpeechMusicSegmenter.h
1 
18 #ifndef _SPEECHMUSIC_PLUGIN_H_
19 #define _SPEECHMUSIC_PLUGIN_H_
20 
21 #include <vector>
22 #include <vamp-sdk/Plugin.h>
23 #include <math.h>
24 #include <cmath>
25 
26 using std::string;
27 using std::vector;
28 
76 class SpeechMusicSegmenter : public Vamp::Plugin
77 {
78 public:
80  SpeechMusicSegmenter(float inputSampleRate);
81  virtual ~SpeechMusicSegmenter();
82 
83  string getIdentifier() const;
84  string getName() const;
85  string getDescription() const;
86  string getMaker() const;
87  int getPluginVersion() const;
88  string getCopyright() const;
89 
90  InputDomain getInputDomain() const;
91  size_t getPreferredBlockSize() const;
92  size_t getPreferredStepSize() const;
93  size_t getMinChannelCount() const;
94  size_t getMaxChannelCount() const;
95 
96  ParameterList getParameterDescriptors() const;
97  float getParameter(string identifier) const;
98  void setParameter(string identifier, float value);
99 
100  ProgramList getPrograms() const;
101  string getCurrentProgram() const;
102  void selectProgram(string name);
103 
104  OutputList getOutputDescriptors() const;
105 
106  bool initialise(size_t channels, size_t stepSize, size_t blockSize);
107  void reset();
108 
109  FeatureSet process(const float *const *inputBuffers,
110  Vamp::RealTime timestamp);
111 
112  FeatureSet getRemainingFeatures();
113  vector<double> getSkewnessFunction();
115 
116 protected:
118  size_t m_blockSize;
120  vector<double> m_zcr;
121  int m_nframes;
122  int resolution;
123  double margin;
124  double change_threshold;
125  double decision_threshold;
126  double min_music_length;
127 };
128 
129 
130 
131 #endif
Calculates boundaries between speech and music.
Definition: SpeechMusicSegmenter.h:76