bbc-vamp-plugins  1.0
SpeechMusicSegmenter.h
00001 
00018 #ifndef _SPEECHMUSIC_PLUGIN_H_
00019 #define _SPEECHMUSIC_PLUGIN_H_
00020 
00021 #include <vector>
00022 #include <vamp-sdk/Plugin.h>
00023 #include <math.h>
00024 #include <cmath>
00025 
00026 using std::string;
00027 using std::vector;
00028 
00076 class SpeechMusicSegmenter : public Vamp::Plugin
00077 {
00078 public:
00080     SpeechMusicSegmenter(float inputSampleRate);
00081     virtual ~SpeechMusicSegmenter();
00082 
00083     string getIdentifier() const;
00084     string getName() const;
00085     string getDescription() const;
00086     string getMaker() const;
00087     int getPluginVersion() const;
00088     string getCopyright() const;
00089 
00090     InputDomain getInputDomain() const;
00091     size_t getPreferredBlockSize() const;
00092     size_t getPreferredStepSize() const;
00093     size_t getMinChannelCount() const;
00094     size_t getMaxChannelCount() const;
00095 
00096     ParameterList getParameterDescriptors() const;
00097     float getParameter(string identifier) const;
00098     void setParameter(string identifier, float value);
00099 
00100     ProgramList getPrograms() const;
00101     string getCurrentProgram() const;
00102     void selectProgram(string name);
00103 
00104     OutputList getOutputDescriptors() const;
00105 
00106     bool initialise(size_t channels, size_t stepSize, size_t blockSize);
00107     void reset();
00108 
00109     FeatureSet process(const float *const *inputBuffers,
00110                        Vamp::RealTime timestamp);
00111 
00112     FeatureSet getRemainingFeatures();
00113     vector<double> getSkewnessFunction();
00115 
00116 protected:
00118     size_t m_blockSize;
00120     vector<double> m_zcr;
00121     int m_nframes;
00122     int resolution;
00123     double margin;
00124     double change_threshold;
00125     double decision_threshold;
00126     double min_music_length;
00127 };
00128 
00129 
00130 
00131 #endif